1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00

amadeus: Fix possible underflow in delay time delay effect (#1739)

This fix an underflow in the setup of delay time in the delay effect.

THis fix a regression caused by Amadeus on Shovel Knight: Treasure
Trove.
This commit is contained in:
Mary 2020-11-21 21:57:49 +01:00 committed by GitHub
parent 3dc9bab91f
commit 92bcdcb369
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,15 @@ namespace Ryujinx.Audio.Renderer.Dsp.Effect
{
CurrentSampleCount = Math.Min(SampleCountMax, targetSampleCount);
_currentSampleIndex = 0;
_lastSampleIndex = CurrentSampleCount - 1;
if (CurrentSampleCount == 0)
{
_lastSampleIndex = 0;
}
else
{
_lastSampleIndex = CurrentSampleCount - 1;
}
}
public void SetDelay(float delayTime)