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.

This commit is contained in:
Nik Henson 2011-08-31 22:30:45 +00:00
parent de3e56fc96
commit b25cbb2391

View file

@ -61,11 +61,8 @@ static void PlayCallback(void *data, Uint8 *stream, int len)
// Check if play position has moved past end of buffer // Check if play position has moved past end of buffer
if (playPos >= audioBufferSize) if (playPos >= audioBufferSize)
{ // If so, wrap it around to beginning again (but keep write wrapped flag as before)
// If so, wrap it around to beginning again and reset write wrapped flag
playPos -= audioBufferSize; playPos -= audioBufferSize;
writeWrapped = false;
}
else else
// Otherwise, set write wrapped flag as will now appear as if write has wrapped but play position has not // Otherwise, set write wrapped flag as will now appear as if write has wrapped but play position has not
writeWrapped = true; writeWrapped = true;
@ -243,11 +240,8 @@ void OutputAudio(unsigned numSamples, INT16 *leftBuffer, INT16 *rightBuffer)
// Check if play position has moved past end of buffer // Check if play position has moved past end of buffer
if (playPos >= audioBufferSize) if (playPos >= audioBufferSize)
{ // If so, wrap it around to beginning again (but keep write wrapped flag as before)
// If so, wrap it around to beginning again and reset write wrapped flag
playPos -= audioBufferSize; playPos -= audioBufferSize;
writeWrapped = false;
}
else else
{ {
// Otherwise, set write wrapped flag as will now appear as if write has wrapped but play position has not // Otherwise, set write wrapped flag as will now appear as if write has wrapped but play position has not