diff options
author | Zaggy1024 <zaggy1024@gmail.com> | 2022-11-14 00:54:21 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-25 23:28:39 +0100 |
commit | 5c2cede2c95a0a6109d6d019a62ec08d7f31882a (patch) | |
tree | 78781b78dd26119ca9e2f40ebddddb8bcf1e02f3 /Userland/Libraries/LibVideo/Containers | |
parent | 9a9fe084493203aa031209cbd5a8723a7ea198d9 (diff) | |
download | serenity-5c2cede2c95a0a6109d6d019a62ec08d7f31882a.zip |
LibVideo: Implement accurate seeking to inter frames in PlaybackManager
This implements the PlaybackManager portion of seeking, so that it can
seek to any frame in the video by dropping all preceding frames until
it reaches the seek point.
MatroskaDemuxer currently will only seek to the start of the video.
That means that every seek has to drop all the frames until it comes
across the target timestamp.
Diffstat (limited to 'Userland/Libraries/LibVideo/Containers')
-rw-r--r-- | Userland/Libraries/LibVideo/Containers/Matroska/MatroskaDemuxer.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/MatroskaDemuxer.cpp b/Userland/Libraries/LibVideo/Containers/Matroska/MatroskaDemuxer.cpp index cab16d4d89..04920926f5 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/MatroskaDemuxer.cpp +++ b/Userland/Libraries/LibVideo/Containers/Matroska/MatroskaDemuxer.cpp @@ -53,15 +53,13 @@ DecoderErrorOr<MatroskaDemuxer::TrackStatus*> MatroskaDemuxer::get_track_status( return &m_track_statuses.get(track).release_value(); } -DecoderErrorOr<void> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, Time timestamp) +DecoderErrorOr<void> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, Time) { - if (timestamp.is_zero()) { - // Removing the track status will cause us to start from the beginning. - m_track_statuses.remove(track); - return {}; - } - - return DecoderError::not_implemented(); + // Removing the track status will cause us to start from the beginning. + // FIXME: We just go back to the beginning always, so that the PlaybackManager seeking + // technology can be tested. + m_track_statuses.remove(track); + return {}; } DecoderErrorOr<NonnullOwnPtr<Sample>> MatroskaDemuxer::get_next_sample_for_track(Track track) |