diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-05-01 18:18:54 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-05-01 18:18:54 +0000 |
commit | b8d1a55fbd7d35cdb1e16373e978524b345ad25d (patch) | |
tree | 4803984d558a84a081bd5818af851ddc6deb81c1 | |
parent | 3e853064fa0473d77247c00ef542f45bbab1f600 (diff) | |
download | rockbox-b8d1a55fbd7d35cdb1e16373e978524b345ad25d.tar.gz rockbox-b8d1a55fbd7d35cdb1e16373e978524b345ad25d.zip |
Properly set audio_is_initialized flag for swcodec devices ad use it when initializing crossfade. This should fix the problems with resuming playback at startup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9853 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/playback.c | 11 | ||||
-rw-r--r-- | firmware/mp3_playback.c | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/apps/playback.c b/apps/playback.c index a2f1672ea1..6f5084e14a 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -146,7 +146,11 @@ enum { #endif #define CODEC_IRAM_SIZE 0xc000 +#ifndef SIMULATOR extern bool audio_is_initialized; +#else +static bool audio_is_initialized = false; +#endif /* Buffer control thread. */ static struct event_queue audio_queue; @@ -2726,7 +2730,7 @@ void audio_set_buffer_margin(int setting) void audio_set_crossfade(int enable) { size_t size; - bool was_playing = playing; + bool was_playing = (playing && audio_is_initialized); size_t offset = 0; int seconds = 1; @@ -2885,11 +2889,10 @@ static void playback_init(void) filebuf = (char *)&audiobuf[MALLOC_BUFSIZE]; - /* FIXME: This call will infinite loop if called on the audio thread - * while playing, fortunately this is an init call so that should be - * impossible. */ audio_set_crossfade(global_settings.crossfade); + audio_is_initialized = true; + sound_settings_apply(); } diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c index 58dc3f72fb..a5a251160e 100644 --- a/firmware/mp3_playback.c +++ b/firmware/mp3_playback.c @@ -624,7 +624,6 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness, playstart_tick = 0; cumulative_ticks = 0; callback_for_more = 0; - audio_is_initialized = true; #endif } |