Merge pull request #698 from roderickvd/fix-basic-normalisation

This commit is contained in:
Sasha Hilton 2021-04-23 22:04:04 +01:00 committed by GitHub
commit 1ff7c43e7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -246,7 +246,7 @@ impl NormalisationData {
let limited_normalisation_power = Self::ratio_to_db(limited_normalisation_factor); let limited_normalisation_power = Self::ratio_to_db(limited_normalisation_factor);
if config.normalisation_method == NormalisationMethod::Basic { if config.normalisation_method == NormalisationMethod::Basic {
warn!("Limiting gain to {:.2} for the duration of this track to stay under normalisation threshold.", limited_normalisation_power); warn!("Limiting gain to {:.2} dB for the duration of this track to stay under normalisation threshold.", limited_normalisation_power);
normalisation_factor = limited_normalisation_factor; normalisation_factor = limited_normalisation_factor;
} else { } else {
warn!( warn!(
@ -1161,8 +1161,8 @@ impl PlayerInternal {
} }
if self.config.normalisation if self.config.normalisation
&& (f32::abs(normalisation_factor - 1.0) < f32::EPSILON && !(f32::abs(normalisation_factor - 1.0) <= f32::EPSILON
|| self.config.normalisation_method != NormalisationMethod::Basic) && self.config.normalisation_method == NormalisationMethod::Basic)
{ {
for sample in data.iter_mut() { for sample in data.iter_mut() {
let mut actual_normalisation_factor = normalisation_factor; let mut actual_normalisation_factor = normalisation_factor;