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:
parent
3dc9bab91f
commit
92bcdcb369
1 changed files with 9 additions and 1 deletions
|
@ -42,8 +42,16 @@ namespace Ryujinx.Audio.Renderer.Dsp.Effect
|
||||||
{
|
{
|
||||||
CurrentSampleCount = Math.Min(SampleCountMax, targetSampleCount);
|
CurrentSampleCount = Math.Min(SampleCountMax, targetSampleCount);
|
||||||
_currentSampleIndex = 0;
|
_currentSampleIndex = 0;
|
||||||
|
|
||||||
|
if (CurrentSampleCount == 0)
|
||||||
|
{
|
||||||
|
_lastSampleIndex = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
_lastSampleIndex = CurrentSampleCount - 1;
|
_lastSampleIndex = CurrentSampleCount - 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void SetDelay(float delayTime)
|
public void SetDelay(float delayTime)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue