mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +00:00
LibVideo: Add a fast seeking mode to seek only to keyframes
Now that we're able to find the nearest keyframe, we can have a fast seeking mode that only seeks to keyframes, so that it doesn't have to also decode inter frames until it reaches the timestamp. The default is still accurate seeking, so that the entire seeking implementation can be tested.
This commit is contained in:
parent
eef8867d9e
commit
fd3ffd88ce
5 changed files with 22 additions and 6 deletions
|
@ -236,7 +236,10 @@ void PlaybackManager::seek_to_timestamp(Time timestamp)
|
|||
m_frame_queue->clear();
|
||||
m_next_frame.clear();
|
||||
m_skipped_frames = 0;
|
||||
m_seek_to_media_time = timestamp;
|
||||
if (m_seek_mode == SeekMode::Accurate)
|
||||
m_seek_to_media_time = timestamp;
|
||||
else
|
||||
m_seek_to_media_time = result.release_value();
|
||||
m_last_present_in_media_time = Time::min();
|
||||
m_last_present_in_real_time = Time::zero();
|
||||
m_present_timer->stop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue