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 }