From b25cbb23919ebe748115d0201ec0861e1dc6fa6e Mon Sep 17 00:00:00 2001 From: Nik Henson Date: Wed, 31 Aug 2011 22:30:45 +0000 Subject: [PATCH] Removed setting of writeWrapped to false always on buffer under-run when underRunLoop is true as this is wrong. Suspect this may have been causing looping bug. --- Src/OSD/SDL/Audio.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Src/OSD/SDL/Audio.cpp b/Src/OSD/SDL/Audio.cpp index dbaceb1..7280c7f 100755 --- a/Src/OSD/SDL/Audio.cpp +++ b/Src/OSD/SDL/Audio.cpp @@ -61,11 +61,8 @@ static void PlayCallback(void *data, Uint8 *stream, int len) // Check if play position has moved past end of buffer if (playPos >= audioBufferSize) - { - // If so, wrap it around to beginning again and reset write wrapped flag + // If so, wrap it around to beginning again (but keep write wrapped flag as before) playPos -= audioBufferSize; - writeWrapped = false; - } else // Otherwise, set write wrapped flag as will now appear as if write has wrapped but play position has not writeWrapped = true; @@ -243,11 +240,8 @@ void OutputAudio(unsigned numSamples, INT16 *leftBuffer, INT16 *rightBuffer) // Check if play position has moved past end of buffer if (playPos >= audioBufferSize) - { - // If so, wrap it around to beginning again and reset write wrapped flag + // If so, wrap it around to beginning again (but keep write wrapped flag as before) playPos -= audioBufferSize; - writeWrapped = false; - } else { // Otherwise, set write wrapped flag as will now appear as if write has wrapped but play position has not