From 8adbde90f5f1384c6ae2b75eb96e5ec6c14842de Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 3 Apr 2020 02:48:35 -0700 Subject: Jump to the target gain if the fade amount is small --- alc/mixer/mixer_c.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'alc/mixer/mixer_c.cpp') 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_(const al::span InSamples, const al::span std::numeric_limits::epsilon()) + if(!(std::fabs(diff) > std::numeric_limits::epsilon())) + gain = *TargetGains; + else { const ALfloat step{diff * delta}; ALfloat step_count{0.0f}; @@ -175,8 +177,8 @@ void Mix_(const al::span InSamples, const al::span