1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-11-25 03:42:36 +01:00

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;