summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playback.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c
index bc3d773..1ea1c67 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);
}