1
0
Fork 0
forked from len0rd/rockbox

Another fix for crashing when changing crossfade settings

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11086 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Steve Bavin 2006-09-28 15:17:59 +00:00
parent 03aa9c9fea
commit c9a78621af

View file

@ -625,10 +625,12 @@ void audio_set_crossfade(int enable)
gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
LOGFQUEUE("audio > audio Q_AUDIO_STOP");
queue_post(&audio_queue, Q_AUDIO_STOP, 0);
while (audio_codec_loaded || playing)
while (audio_codec_loaded)
yield();
}
voice_stop();
/* Re-initialize audio system. */
pcmbuf_init(size);
pcmbuf_crossfade_enable(enable);
@ -646,7 +648,7 @@ void audio_set_crossfade(int enable)
/* Wait for the playback to start again (and display the splash
screen during that period. */
while (!playing && !audio_codec_loaded)
while (!playing)
yield();
}
}
@ -698,15 +700,7 @@ void voice_init(void)
return; /* Audio buffers not yet set up */
if (voice_thread_p)
{
logf("Terminating voice codec");
remove_thread(voice_thread_p);
if (current_codec == CODEC_IDX_VOICE)
mutex_unlock(&mutex_codecthread);
queue_delete(&voice_queue);
voice_thread_p = NULL;
voice_codec_loaded = false;
}
return;
if (!talk_voice_required())
return;
@ -733,7 +727,7 @@ void voice_stop(void)
LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
queue_post(&voice_queue, Q_VOICE_STOP, 0);
while (voice_is_playing && !queue_empty(&voice_queue))
while (voice_is_playing)
yield();
if (!playing)
pcmbuf_play_stop();