瀏覽代碼

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.
Zaggy1024 2 年之前
父節點
當前提交
edec6bdc32
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Userland/Libraries/LibVideo/PlaybackManager.cpp

+ 4 - 4
Userland/Libraries/LibVideo/PlaybackManager.cpp

@@ -60,7 +60,7 @@ void PlaybackManager::set_playback_status(PlaybackStatus status)
                 m_skipped_frames = 0;
                 m_skipped_frames = 0;
             }
             }
             m_last_present_in_real_time = Time::now_monotonic();
             m_last_present_in_real_time = Time::now_monotonic();
-            m_present_timer->start();
+            m_present_timer->start(0);
         } else {
         } else {
             m_last_present_in_media_time = current_playback_time();
             m_last_present_in_media_time = current_playback_time();
             m_last_present_in_real_time = Time::zero();
             m_last_present_in_real_time = Time::zero();
@@ -89,7 +89,7 @@ bool PlaybackManager::prepare_next_frame()
         return false;
         return false;
     auto frame_item = m_frame_queue->dequeue();
     auto frame_item = m_frame_queue->dequeue();
     m_next_frame.emplace(move(frame_item));
     m_next_frame.emplace(move(frame_item));
-    m_decode_timer->start();
+    m_decode_timer->start(0);
     return true;
     return true;
 }
 }
 
 
@@ -170,7 +170,7 @@ void PlaybackManager::update_presented_frame()
     }
     }
 
 
     set_playback_status(PlaybackStatus::Buffering);
     set_playback_status(PlaybackStatus::Buffering);
-    m_decode_timer->start();
+    m_decode_timer->start(0);
 }
 }
 
 
 void PlaybackManager::restart_playback()
 void PlaybackManager::restart_playback()
@@ -266,7 +266,7 @@ void PlaybackManager::on_decode_timer()
 
 
     // Continually decode until buffering is complete
     // Continually decode until buffering is complete
     if (is_buffering())
     if (is_buffering())
-        m_decode_timer->start();
+        m_decode_timer->start(0);
 }
 }
 
 
 }
 }