1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-09-19 16:01:37 +02: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 259bf81e20
commit ced3ce8d5e

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;