diff options
author | Zaggy1024 <zaggy1024@gmail.com> | 2022-11-14 00:48:31 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-25 23:28:39 +0100 |
commit | 9a9fe084493203aa031209cbd5a8723a7ea198d9 (patch) | |
tree | 1f1346df94df815c8cf1d53a2a837bcbb413d8a3 /Userland/Applications/VideoPlayer | |
parent | f31621b3f20b94f319390ac8fc786ee7f42d64d0 (diff) | |
download | serenity-9a9fe084493203aa031209cbd5a8723a7ea198d9.zip |
LibVideo: Rewrite the video frame present function to be more readable
The PlaybackManager::update_presented_frame function was getting out of
hand and adding seeking was making it illegible. This rewrites it to be
(hopefully) quite a bit more readable, and adds a few comments to help
future readers of the code.
In addition, some helpful debugging prints were added that should help
debug any future issues with the player.
Diffstat (limited to 'Userland/Applications/VideoPlayer')
-rw-r--r-- | Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp index bafc0f523a..11350c7e38 100644 --- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp +++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp @@ -114,7 +114,7 @@ void VideoPlayerWidget::update_play_pause_icon() m_play_pause_action->set_enabled(true); - if (m_playback_manager->is_playing() || m_playback_manager->is_buffering()) + if (m_playback_manager->is_playing()) m_play_pause_action->set_icon(m_pause_icon); else m_play_pause_action->set_icon(m_play_icon); @@ -140,7 +140,7 @@ void VideoPlayerWidget::toggle_pause() { if (!m_playback_manager) return; - if (m_playback_manager->is_playing() || m_playback_manager->is_buffering()) + if (m_playback_manager->is_playing()) pause_playback(); else resume_playback(); |