aboutsummaryrefslogtreecommitdiffstats
path: root/alc/voice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/voice.cpp')
-rw-r--r--alc/voice.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/alc/voice.cpp b/alc/voice.cpp
index 310e3f3c..0d1da6ae 100644
--- a/alc/voice.cpp
+++ b/alc/voice.cpp
@@ -359,14 +359,14 @@ void DoHrtfMix(const float *samples, const uint DstBufferSize, DirectParams &par
const float a{static_cast<float>(fademix) / static_cast<float>(Counter)};
gain = lerp(parms.Hrtf.Old.Gain, TargetGain, a);
}
- MixHrtfFilter hrtfparams;
- hrtfparams.Coeffs = &parms.Hrtf.Target.Coeffs;
- hrtfparams.Delay = parms.Hrtf.Target.Delay;
- hrtfparams.Gain = 0.0f;
- hrtfparams.GainStep = gain / static_cast<float>(fademix);
+ MixHrtfFilter hrtfparams{
+ parms.Hrtf.Target.Coeffs,
+ parms.Hrtf.Target.Delay,
+ 0.0f, gain / static_cast<float>(fademix)};
MixHrtfBlendSamples(HrtfSamples, AccumSamples+OutPos, IrSize, &parms.Hrtf.Old, &hrtfparams,
fademix);
+
/* Update the old parameters with the result. */
parms.Hrtf.Old = parms.Hrtf.Target;
parms.Hrtf.Old.Gain = gain;
@@ -387,12 +387,13 @@ void DoHrtfMix(const float *samples, const uint DstBufferSize, DirectParams &par
gain = lerp(parms.Hrtf.Old.Gain, TargetGain, a);
}
- MixHrtfFilter hrtfparams;
- hrtfparams.Coeffs = &parms.Hrtf.Target.Coeffs;
- hrtfparams.Delay = parms.Hrtf.Target.Delay;
- hrtfparams.Gain = parms.Hrtf.Old.Gain;
- hrtfparams.GainStep = (gain - parms.Hrtf.Old.Gain) / static_cast<float>(todo);
+ MixHrtfFilter hrtfparams{
+ parms.Hrtf.Target.Coeffs,
+ parms.Hrtf.Target.Delay,
+ parms.Hrtf.Old.Gain,
+ (gain - parms.Hrtf.Old.Gain) / static_cast<float>(todo)};
MixHrtfSamples(HrtfSamples+fademix, AccumSamples+OutPos, IrSize, &hrtfparams, todo);
+
/* Store the now-current gain for next time. */
parms.Hrtf.Old.Gain = gain;
}