Skip to content

Commit

Permalink
SasAudio: Cap the cycle estimate at 1200 to prevent crackling in FFT. F…
Browse files Browse the repository at this point in the history
…ixes #9956.
  • Loading branch information
hrydgard committed Aug 22, 2019
1 parent 24f4cea commit 3229b93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Core/HW/SasAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3229b93

Please sign in to comment.