From 6a6c322a197bf07c72010aae40dd63f12e9cf98a Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Sun, 23 Apr 2006 22:54:01 +0000 Subject: [PATCH] Improve stop behavior git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9779 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/playback.c b/apps/playback.c index bc3d773cbb..1ea1c6759c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1784,6 +1784,11 @@ static void stop_codec_flush(void) pcmbuf_pause(true); while (audio_codec_loaded) yield(); + /* If the audio codec is not loaded any more, and the audio is still + * playing, it is now and _only_ now safe to call this function from the + * audio thread */ + if (pcm_is_playing()) + pcmbuf_play_stop(); pcmbuf_pause(paused); }