summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibVideo/PlaybackManager.cpp
diff options
context:
space:
mode:
authorZaggy1024 <zaggy1024@gmail.com>2023-02-06 04:11:32 -0600
committerAndreas Kling <kling@serenityos.org>2023-02-08 21:52:42 +0100
commitb0db56cd39e20035d426bb30a6e7bd76318bebee (patch)
treeaa5855e4861230648aabbd040a2ef7b39b99903e /Userland/Libraries/LibVideo/PlaybackManager.cpp
parent1f650088a0b4ae99b793ca13377e7e2238ded8d5 (diff)
downloadserenity-b0db56cd39e20035d426bb30a6e7bd76318bebee.zip
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.
Diffstat (limited to 'Userland/Libraries/LibVideo/PlaybackManager.cpp')
-rw-r--r--Userland/Libraries/LibVideo/PlaybackManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp
index 9a808402b8..5a49f32bd2 100644
--- a/Userland/Libraries/LibVideo/PlaybackManager.cpp
+++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp
@@ -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)