Fix crash in quality auto-toggle.
This commit is contained in:
parent
0067245739
commit
7684466acf
|
@ -73,10 +73,7 @@ PlaybackControls::PlaybackControls(
|
|||
_speedToggle->setSpeed(_speedControllable
|
||||
? _delegate->playbackControlsCurrentSpeed(false)
|
||||
: 1.);
|
||||
const auto quality = _delegate->playbackControlsCurrentQuality();
|
||||
_speedToggle->setQuality((_qualitiesList.empty() || !quality.manual)
|
||||
? 0
|
||||
: quality.height);
|
||||
updateSpeedToggleQuality();
|
||||
|
||||
if (const auto controller = _speedController.get()) {
|
||||
controller->menuToggledValue(
|
||||
|
@ -221,10 +218,15 @@ void PlaybackControls::saveSpeed(float64 speed) {
|
|||
}
|
||||
|
||||
void PlaybackControls::saveQuality(int quality) {
|
||||
_speedToggle->setQuality(quality);
|
||||
_speedToggle->setQuality(_qualitiesList.empty() ? 0 : quality);
|
||||
_delegate->playbackControlsQualityChanged(quality);
|
||||
}
|
||||
|
||||
void PlaybackControls::updateSpeedToggleQuality() {
|
||||
const auto quality = _delegate->playbackControlsCurrentQuality();
|
||||
_speedToggle->setQuality(_qualitiesList.empty() ? 0 : quality.height);
|
||||
}
|
||||
|
||||
void PlaybackControls::updatePlaybackSpeed(float64 speed) {
|
||||
DEBUG_LOG(("Media playback speed: update to %1.").arg(speed));
|
||||
_delegate->playbackControlsSpeedChanged(speed);
|
||||
|
|
|
@ -97,6 +97,7 @@ private:
|
|||
void saveSpeed(float64 speed);
|
||||
|
||||
void saveQuality(int quality);
|
||||
void updateSpeedToggleQuality();
|
||||
|
||||
const not_null<Delegate*> _delegate;
|
||||
|
||||
|
|
Loading…
Reference in New Issue