summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2006-09-28 09:20:56 +0000
committerSteve Bavin <pondlife@pondlife.me>2006-09-28 09:20:56 +0000
commitb2269cce949c217453facfbc3eecadd7ea5ef9bc (patch)
treeb9eab0afe5ce143c2b251fb10532c46a6ff4f24c
parent8c9d5f35f005140629d116a09d75e36ddc44f4f3 (diff)
downloadrockbox-b2269cce949c217453facfbc3eecadd7ea5ef9bc.tar.gz
rockbox-b2269cce949c217453facfbc3eecadd7ea5ef9bc.zip
Fix hangs when changing crossfade settings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11084 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 2b6081be42..5996886d7e 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -620,12 +620,13 @@ void audio_set_crossfade(int enable)
620 { 620 {
621 /* Store the track resume position */ 621 /* Store the track resume position */
622 offset = cur_ti->id3.offset; 622 offset = cur_ti->id3.offset;
623
623 /* Playback has to be stopped before changing the buffer size. */ 624 /* Playback has to be stopped before changing the buffer size. */
625 gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
624 LOGFQUEUE("audio > audio Q_AUDIO_STOP"); 626 LOGFQUEUE("audio > audio Q_AUDIO_STOP");
625 queue_post(&audio_queue, Q_AUDIO_STOP, 0); 627 queue_post(&audio_queue, Q_AUDIO_STOP, 0);
626 while (audio_codec_loaded) 628 while (audio_codec_loaded || playing)
627 yield(); 629 yield();
628 gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
629 } 630 }
630 631
631 /* Re-initialize audio system. */ 632 /* Re-initialize audio system. */
@@ -638,13 +639,14 @@ void audio_set_crossfade(int enable)
638 voice_init(); 639 voice_init();
639 640
640 /* Restart playback. */ 641 /* Restart playback. */
641 if (was_playing) { 642 if (was_playing)
643 {
642 LOGFQUEUE("audio > audio Q_AUDIO_PLAY"); 644 LOGFQUEUE("audio > audio Q_AUDIO_PLAY");
643 queue_post(&audio_queue, Q_AUDIO_PLAY, (void *)offset); 645 queue_post(&audio_queue, Q_AUDIO_PLAY, (void *)offset);
644 646
645 /* Wait for the playback to start again (and display the splash 647 /* Wait for the playback to start again (and display the splash
646 screen during that period. */ 648 screen during that period. */
647 while (playing && !audio_codec_loaded) 649 while (!playing && !audio_codec_loaded)
648 yield(); 650 yield();
649 } 651 }
650} 652}