Respect disabled normalisation with maximum volume (#1159)

This commit is contained in:
AeRo 2023-05-06 09:47:08 +02:00 committed by GitHub
parent 03b547d3b3
commit 31d18f7e30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -112,6 +112,7 @@ https://github.com/librespot-org/librespot
from the beginning
- [playback] Handle disappearing and invalid devices better
- [playback] Handle seek, pause, and play commands while loading
- [playback] Handle disabled normalisation correctly when using fixed volume
- [metadata] Fix missing colon when converting named spotify IDs to URIs
## [0.4.2] - 2022-07-29

View file

@ -1545,9 +1545,11 @@ impl PlayerInternal {
// dynamic method, there may still be peaks that we want to shave off.
// No matter the case we apply volume attenuation last if there is any.
if !self.config.normalisation && volume < 1.0 {
for sample in data.iter_mut() {
*sample *= volume;
if !self.config.normalisation {
if volume < 1.0 {
for sample in data.iter_mut() {
*sample *= volume;
}
}
} else if self.config.normalisation_method == NormalisationMethod::Basic
&& (normalisation_factor < 1.0 || volume < 1.0)