From 69b5f2fddfc55cd5d3ba211b56473c96670b6a8b Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 29 Aug 2014 23:05:24 +0200 Subject: [PATCH] Fixes #1658 --- radio/src/audio_arm.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index 24b519f14..a13255312 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -607,7 +607,6 @@ int WavContext::mixBuffer(AudioBuffer *buffer, int volume, unsigned int fade) } } - clear(); return -result; } #else @@ -719,12 +718,18 @@ void AudioQueue::wakeup() } // mix the normal context (tones and wavs) - if (normalContext.fragment.type == FRAGMENT_TONE) + if (normalContext.fragment.type == FRAGMENT_TONE) { result = normalContext.tone.mixBuffer(buffer, g_eeGeneral.beepVolume, fade); - else if (normalContext.fragment.type == FRAGMENT_FILE) + } + else if (normalContext.fragment.type == FRAGMENT_FILE) { result = normalContext.wav.mixBuffer(buffer, g_eeGeneral.wavVolume, fade); - else + if (result < 0) { + normalContext.wav.clear(); + } + } + else { result = 0; + } if (result > 0) { size = max(size, result); fade += 1;