From 8b08935a3b3bfcfec60fc5e9a3fef2ef87b739c4 Mon Sep 17 00:00:00 2001 From: Steve Bavin Date: Thu, 28 Sep 2006 16:45:23 +0000 Subject: [PATCH] Flush queued voice clips when not playing audio git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11087 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/playback.c b/apps/playback.c index b80cee7486..76f0788583 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -976,8 +976,9 @@ static void* voice_request_buffer_callback(size_t *realsize, size_t reqsize) voice_remaining = 0; voicebuf = NULL; voice_boost_cpu(false); - ci_voice.new_track = 1; + /* Force the codec to think it's changing tracks */ + ci_voice.new_track = 1; *realsize = 0; return NULL; } @@ -996,6 +997,11 @@ static void* voice_request_buffer_callback(size_t *realsize, size_t reqsize) LOGFQUEUE("voice < Q_VOICE_PLAY"); if (!voice_is_playing) { + /* Slight hack - flush PCM buffer if only being used for voice */ + if (!playing && pcm_is_playing()) + pcmbuf_play_stop(); + + /* Set up new voice data */ struct voice_info *voice_data; voice_is_playing = true; voice_boost_cpu(true);