HLE DSP: Fix up resampling a bit

This commit is contained in:
wheremyfoodat 2024-11-09 23:52:29 +02:00
parent c70388dbeb
commit 6a79309722

View file

@ -487,10 +487,10 @@ namespace Audio {
decodeBuffer(source); decodeBuffer(source);
} else { } else {
uint maxSampleCount = uint(float(Audio::samplesInFrame) * 1.0);
usize outputCount = 0; usize outputCount = 0;
static constexpr usize maxSamples = Audio::samplesInFrame;
while (outputCount < maxSampleCount) { while (outputCount < maxSamples) {
if (source.currentSamples.empty()) { if (source.currentSamples.empty()) {
if (source.buffers.empty()) { if (source.buffers.empty()) {
break; break;
@ -518,9 +518,9 @@ namespace Audio {
); );
break; break;
} }
source.samplePosition += u32(outputCount);
} }
source.samplePosition += u32(outputCount * source.rateMultiplier);
} }
} }