From 51a447852f17b19144e879601cdfa09a6bbdc3bd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 28 Sep 2018 18:34:21 -0700 Subject: [PATCH] Simplify a lower-bound clamp --- Alc/mastering.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Alc/mastering.c b/Alc/mastering.c index 52813a54..e7908828 100644 --- a/Alc/mastering.c +++ b/Alc/mastering.c @@ -263,8 +263,7 @@ static void GainCompressor(Compressor *Comp, const ALsizei SamplesToDo) if(autoDeclip) { x_G = sideChain[(index + i) & mask]; - if((x_G - c_dev - c_est - y_L) > threshold) - c_dev = x_G - c_est - y_L - threshold; + c_dev = maxf(c_dev, x_G - y_L - threshold - c_est); } postGain = -(c_dev + c_est);