From b8d1a55fbd7d35cdb1e16373e978524b345ad25d Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Mon, 1 May 2006 18:18:54 +0000 Subject: 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 --- apps/playback.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apps') 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(); } -- cgit v1.2.3