aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-10-26 01:48:12 -0700
committerChris Robinson <[email protected]>2015-10-26 01:48:12 -0700
commit45f11d7b64c2e7c0f2cd348ad4ae329b6aef4b3d (patch)
treee23196f64b716413eb6f7326ce012d1eca3ba8d5 /Alc
parent90349b384fe538b0d160b5ff0485d6235b1c6f9d (diff)
Set the current gain immediately if the target is close enough
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b4927ee6..456c55c6 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -236,10 +236,13 @@ static void UpdateDryStepping(DirectParams *params, ALuint num_chans, ALuint ste
for(j = 0;j < params->OutChannels;j++)
{
ALfloat diff = gains[j].Target - gains[j].Current;
- if(fabs(diff) >= GAIN_SILENCE_THRESHOLD)
+ if(fabsf(diff) >= GAIN_SILENCE_THRESHOLD)
gains[j].Step = diff * delta;
else
+ {
+ gains[j].Current = gains[j].Target;
gains[j].Step = 0.0f;
+ }
}
}
params->Counter = steps;
@@ -265,10 +268,13 @@ static void UpdateWetStepping(SendParams *params, ALuint num_chans, ALuint steps
for(i = 0;i < num_chans;i++)
{
ALfloat diff = params->Gains[i].Target - params->Gains[i].Current;
- if(fabs(diff) >= GAIN_SILENCE_THRESHOLD)
+ if(fabsf(diff) >= GAIN_SILENCE_THRESHOLD)
params->Gains[i].Step = diff * delta;
else
+ {
+ params->Gains[i].Current = params->Gains[i].Target;
params->Gains[i].Step = 0.0f;
+ }
}
params->Counter = steps;
}