Skip processing when normalisation is disabled

This commit is contained in:
Roderick van Domburg 2021-05-17 21:27:34 +02:00
parent a4ad6d4aa8
commit 9b44fd4f4a
No known key found for this signature in database
GPG key ID: FE2585E713F9F30A

View file

@ -233,6 +233,10 @@ impl NormalisationData {
} }
fn get_factor(config: &PlayerConfig, data: NormalisationData) -> f32 { fn get_factor(config: &PlayerConfig, data: NormalisationData) -> f32 {
if !config.normalisation {
return 1.0;
}
let [gain_db, gain_peak] = match config.normalisation_type { let [gain_db, gain_peak] = match config.normalisation_type {
NormalisationType::Album => [data.album_gain_db, data.album_peak], NormalisationType::Album => [data.album_gain_db, data.album_peak],
NormalisationType::Track => [data.track_gain_db, data.track_peak], NormalisationType::Track => [data.track_gain_db, data.track_peak],