mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #698 from roderickvd/fix-basic-normalisation
This commit is contained in:
commit
1ff7c43e7b
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue