aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-03-26 02:44:34 -0700
committerChris Robinson <[email protected]>2017-03-26 02:44:34 -0700
commit9f4e47d7be96da4759cc008ef376addb32061a99 (patch)
treec9bff0122daa1da0c56c2e30b2c860ef05d2883a /Alc
parent56428cdb74a6ee8449cb9977a9575c22c1844d26 (diff)
Fix HRTF interpolated gain calculation
Diffstat (limited to 'Alc')
-rw-r--r--Alc/mixer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 46de5cbe..b8f4b91f 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -637,7 +637,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei
* fade time this mix handles.
*/
gain = lerp(parms->Hrtf.Old.Gain, parms->Hrtf.Target.Gain,
- minf(1.0f, (ALfloat)Counter/DstBufferSize));
+ (ALfloat)DstBufferSize/Counter);
hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Target.Coeffs);
hrtfparams.Delay[0] = parms->Hrtf.Target.Delay[0];
hrtfparams.Delay[1] = parms->Hrtf.Target.Delay[1];
@@ -650,7 +650,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei
);
/* Update the old parameters with the result. */
parms->Hrtf.Old = parms->Hrtf.Target;
- if(Counter > DstBufferSize)
+ if(DstBufferSize < Counter)
parms->Hrtf.Old.Gain = hrtfparams.Gain;
}
}