Fix receiveSamples buffer advance if maxSamples is bigger than samplesInBuffer

This commit is contained in:
Megamouse 2023-11-30 01:29:14 +01:00
parent 2cf59a0d51
commit 394e1f58b2

View File

@ -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;