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
This commit is contained in:
Hardeep Sidhu 2006-05-01 18:18:54 +00:00
parent 3e853064fa
commit b8d1a55fbd
2 changed files with 7 additions and 5 deletions

View file

@ -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();
}

View file

@ -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
}