-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect disabled normalisation with maximum volume #1159
Conversation
This is a great catch. |
playback/src/player.rs
Outdated
if !self.config.normalisation && volume >= 1.0 { | ||
// do not alter sample | ||
} | ||
else if !self.config.normalisation && volume < 1.0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe nice to group the two non-normalised cases in one branch
if !self.config.normalisation {
if volume < 1.0 {
for sample in data.iter_mut() {
*sample *= volume;
}
}
}
Can you fix the formatting? |
For reasons of style and saving one or two CPU instructions I propose to fold the branch like this: if !self.config.normalisation {
if volume < 0 {
//
}
} else if … |
Have you seen the recent commit? |
Ah very good, thanks! |
LGTM. I think we said we wouldn't backport anything more to master but... What do you say? |
One final question @AER00: would you update the changelog? @kingosticks I don't really consider it anymore for me to say. But to offer my advice, if anyone is going to cut a release, I would spend the time in cutting the 0.5.x release. |
I'm just wondering if there's utility in cherry picking into master. I guess those that care already have their forks. Thanks all for this good fix. |
I've noticed an issue with my CPU usage on a really low end device while playing music with maximum volume. When volume is equal to 1.0 and normalisation is disabled the first condition failed (as it should) and librespot didn't check whether the normalisation was disabled anymore - it just normalised the song anyway using self.config.normalisation_method.