From edec6bdc32dee9cb9af2951e8a4e26a94bdad6db Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Mon, 14 Nov 2022 05:40:59 -0600 Subject: [PATCH] LibVideo: Make all PlaybackManager Timer::start calls set an interval Timers keep their previously set interval even for single-shot mode. We want all timers to fire immediately if they don't have a delay set in the start() call. --- Userland/Libraries/LibVideo/PlaybackManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp index 51b717e8da..ef2a9fffca 100644 --- a/Userland/Libraries/LibVideo/PlaybackManager.cpp +++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp @@ -60,7 +60,7 @@ void PlaybackManager::set_playback_status(PlaybackStatus status) m_skipped_frames = 0; } m_last_present_in_real_time = Time::now_monotonic(); - m_present_timer->start(); + m_present_timer->start(0); } else { m_last_present_in_media_time = current_playback_time(); m_last_present_in_real_time = Time::zero(); @@ -89,7 +89,7 @@ bool PlaybackManager::prepare_next_frame() return false; auto frame_item = m_frame_queue->dequeue(); m_next_frame.emplace(move(frame_item)); - m_decode_timer->start(); + m_decode_timer->start(0); return true; } @@ -170,7 +170,7 @@ void PlaybackManager::update_presented_frame() } set_playback_status(PlaybackStatus::Buffering); - m_decode_timer->start(); + m_decode_timer->start(0); } void PlaybackManager::restart_playback() @@ -266,7 +266,7 @@ void PlaybackManager::on_decode_timer() // Continually decode until buffering is complete if (is_buffering()) - m_decode_timer->start(); + m_decode_timer->start(0); } }