Skip to content

Commit 1ff7c43

Browse files
Merge pull request #698 from roderickvd/fix-basic-normalisation
2 parents 4925adb + d44b74e commit 1ff7c43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

playback/src/player.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl NormalisationData {
246246
let limited_normalisation_power = Self::ratio_to_db(limited_normalisation_factor);
247247

248248
if config.normalisation_method == NormalisationMethod::Basic {
249-
warn!("Limiting gain to {:.2} for the duration of this track to stay under normalisation threshold.", limited_normalisation_power);
249+
warn!("Limiting gain to {:.2} dB for the duration of this track to stay under normalisation threshold.", limited_normalisation_power);
250250
normalisation_factor = limited_normalisation_factor;
251251
} else {
252252
warn!(
@@ -1161,8 +1161,8 @@ impl PlayerInternal {
11611161
}
11621162

11631163
if self.config.normalisation
1164-
&& (f32::abs(normalisation_factor - 1.0) < f32::EPSILON
1165-
|| self.config.normalisation_method != NormalisationMethod::Basic)
1164+
&& !(f32::abs(normalisation_factor - 1.0) <= f32::EPSILON
1165+
&& self.config.normalisation_method == NormalisationMethod::Basic)
11661166
{
11671167
for sample in data.iter_mut() {
11681168
let mut actual_normalisation_factor = normalisation_factor;

0 commit comments

Comments
 (0)