diff --git a/source/SoundTouch/FIFOSampleBuffer.cpp b/source/SoundTouch/FIFOSampleBuffer.cpp index 15d1fc7..80f05b0 100644 --- a/source/SoundTouch/FIFOSampleBuffer.cpp +++ b/source/SoundTouch/FIFOSampleBuffer.cpp @@ -224,13 +224,9 @@ uint FIFOSampleBuffer::receiveSamples(SAMPLETYPE *output, uint maxSamples) // the sample buffer with the 'ptrBegin' function. uint FIFOSampleBuffer::receiveSamples(uint maxSamples) { - if (maxSamples >= samplesInBuffer) + if (maxSamples > samplesInBuffer) { - uint temp; - - temp = samplesInBuffer; - samplesInBuffer = 0; - return temp; + maxSamples = samplesInBuffer; } samplesInBuffer -= maxSamples;