1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

VideoPlayer/LibVideo: Seek accurately when scrolling in the seek bar

Fast seeking does not work correctly when seeking in small increments,
so it is necessary to use accurate seeking when using certain actions.

The PlaybackManager has been changed to accept the seek mode as a
parameter to `seek_to_timestamp` to facilitate this. This now means
that it no longer has to track a seek mode preference.
This commit is contained in:
Zaggy1024 2023-02-06 04:11:32 -06:00 committed by Andreas Kling
parent 1f650088a0
commit b0db56cd39
4 changed files with 6 additions and 21 deletions

View file

@ -109,9 +109,9 @@ void PlaybackManager::timer_callback()
TRY_OR_FATAL_ERROR(m_playback_handler->on_timer_callback());
}
void PlaybackManager::seek_to_timestamp(Time target_timestamp)
void PlaybackManager::seek_to_timestamp(Time target_timestamp, SeekMode seek_mode)
{
TRY_OR_FATAL_ERROR(m_playback_handler->seek(target_timestamp, m_seek_mode));
TRY_OR_FATAL_ERROR(m_playback_handler->seek(target_timestamp, seek_mode));
}
Optional<Time> PlaybackManager::seek_demuxer_to_most_recent_keyframe(Time timestamp, Optional<Time> earliest_available_sample)