diff options
Diffstat (limited to 'alc/mixer/mixer_c.cpp')
-rw-r--r-- | alc/mixer/mixer_c.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp index cdfc57d9..d169ce79 100644 --- a/alc/mixer/mixer_c.cpp +++ b/alc/mixer/mixer_c.cpp @@ -162,7 +162,9 @@ void Mix_<CTag>(const al::span<const float> InSamples, const al::span<FloatBuffe const ALfloat diff{*TargetGains - gain}; auto in_iter = InSamples.begin(); - if(std::fabs(diff) > std::numeric_limits<float>::epsilon()) + if(!(std::fabs(diff) > std::numeric_limits<float>::epsilon())) + gain = *TargetGains; + else { const ALfloat step{diff * delta}; ALfloat step_count{0.0f}; @@ -175,8 +177,8 @@ void Mix_<CTag>(const al::span<const float> InSamples, const al::span<FloatBuffe gain = *TargetGains; else gain += step*step_count; - *CurrentGains = gain; } + *CurrentGains = gain; ++CurrentGains; ++TargetGains; |