diff --git a/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp b/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp index 4a396fbcf9..5ecb20da4c 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp +++ b/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp @@ -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); diff --git a/Telegram/SourceFiles/media/view/media_view_playback_controls.h b/Telegram/SourceFiles/media/view/media_view_playback_controls.h index a67fc73ec7..a91b8ad2e9 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_controls.h +++ b/Telegram/SourceFiles/media/view/media_view_playback_controls.h @@ -97,6 +97,7 @@ private: void saveSpeed(float64 speed); void saveQuality(int quality); + void updateSpeedToggleQuality(); const not_null _delegate;