1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

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.
This commit is contained in:
Zaggy1024 2022-11-14 05:40:59 -06:00 committed by Andreas Kling
parent 75e20a5fd7
commit edec6bdc32

View file

@ -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);
}
}