From: Steinar H. Gunderson Date: Fri, 29 Jul 2016 18:34:22 +0000 (+0200) Subject: Fix a bug where the automatic makeup gain adjustment would never quite get to the... X-Git-Tag: 1.4.0~124 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=e4c7137e189854041ab3076028a31f08dad974c5;p=nageru Fix a bug where the automatic makeup gain adjustment would never quite get to the right level. --- 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