Fix video player volume level changing

Bug:
Sometimes changing of the volume level or mute/unmute has no effect.
It happens because Fader::onTimer get a current volume level from the Mixer,
but it gets an event about the volume modification from the settings.
Bug appear when the method onTimer calling between updating
of the settings and the Mixer volume.

Solution:
Updating the Mixer volume before the settings.
(maybe will be better to get the volume level
from the settings in place of the Mixer,
but I am not sure about other side effects of this)
This commit is contained in:
Alexander Bushnev 2021-05-03 23:04:43 +02:00 committed by John Preston
parent b1906a778e
commit 3af0c37c6b
2 changed files with 3 additions and 8 deletions

View file

@ -1255,12 +1255,6 @@ void OverlayWidget::showSaveMsgFile() {
File::ShowInFolder(_saveMsgFilename);
}
void OverlayWidget::updateMixerVideoVolume() const {
if (_streamed) {
Player::mixer()->setVideoVolume(Core::App().settings().videoVolume());
}
}
void OverlayWidget::close() {
Core::App().hideMediaView();
}
@ -2962,9 +2956,11 @@ void OverlayWidget::playbackControlsSeekFinished(crl::time position) {
}
void OverlayWidget::playbackControlsVolumeChanged(float64 volume) {
if (_streamed) {
Player::mixer()->setVideoVolume(volume);
}
Core::App().settings().setVideoVolume(volume);
Core::App().saveSettingsDelayed();
updateMixerVideoVolume();
}
float64 OverlayWidget::playbackControlsCurrentVolume() {

View file

@ -234,7 +234,6 @@ private:
void refreshLang();
void showSaveMsgFile();
void updateMixerVideoVolume() const;
struct SharedMedia;
using SharedMediaType = SharedMediaWithLastSlice::Type;