From e4c7137e189854041ab3076028a31f08dad974c5 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 29 Jul 2016 20:34:22 +0200 Subject: [PATCH] Fix a bug where the automatic makeup gain adjustment would never quite get to the right level. --- audio_mixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio_mixer.cpp b/audio_mixer.cpp index 06c7f87..3629d74 100644 --- a/audio_mixer.cpp +++ b/audio_mixer.cpp @@ -231,7 +231,7 @@ vector AudioMixer::get_output(double pts, unsigned num_samples, Resamplin double target_loudness_factor, alpha; double loudness_lu = loudness_lufs - ref_level_lufs; double current_makeup_lu = to_db(final_makeup_gain); - target_loudness_factor = from_db(-loudness_lu); + target_loudness_factor = final_makeup_gain * from_db(-loudness_lu); // If we're outside +/- 5 LU uncorrected, we don't count it as // a normal signal (probably silence) and don't change the -- 2.39.2