SasAudio: Cap the cycle estimate at 1200 to prevent crackling in FFT. Fixes #9956.

This commit is contained in:
Henrik Rydgård committed 2019-08-22 23:41:20 +02:00
1 parent 24f4cea071
commit 3229b93673
1 file changed
+3 -1
+3 -1
View File
@@ -413,7 +413,9 @@ int SasInstance::EstimateMixUs() {
}
// Each voice costs extra time, and each byte of grain costs extra time.
return 20 + voicesPlayingCount * 68 + (grainSize * 60) / 100;
int cycles = 20 + voicesPlayingCount * 68 + (grainSize * 60) / 100;
// Cap to 1200 to fix FFT, see issue #9956.
return std::min(cycles, 1200);
}
void SasVoice::ReadSamples(s16 *output, int numSamples) {