summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibVideo
diff options
context:
space:
mode:
authorZaggy1024 <zaggy1024@gmail.com>2023-02-05 17:46:57 -0600
committerAndreas Kling <kling@serenityos.org>2023-02-08 21:52:42 +0100
commit1f650088a0b4ae99b793ca13377e7e2238ded8d5 (patch)
tree1f01ea2d759cf9f0204090ce0e8648c4174038b9 /Userland/Libraries/LibVideo
parent448d1213043ea1968ec79bf3d87a12708725faf3 (diff)
downloadserenity-1f650088a0b4ae99b793ca13377e7e2238ded8d5.zip
LibVideo/Matroska: Stop skipping a cue when seeking forward
This would cause seeks where the approximate starting cue index was one cue before the optimal cue to not change the sample iterator position. Fixing this issue improves accurate seek speeds significantly.
Diffstat (limited to 'Userland/Libraries/LibVideo')
-rw-r--r--Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp
index ddde35366e..a0e9c780f0 100644
--- a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp
+++ b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp
@@ -798,12 +798,11 @@ DecoderErrorOr<void> Reader::seek_to_cue_for_timestamp(SampleIterator& iterator,
}
while (index < cue_points.size()) {
- auto const& cue_point = cue_points[index++];
+ auto const& cue_point = cue_points[++index];
dbgln_if(MATROSKA_DEBUG, "Checking future cue point {}ms", cue_point.timestamp().to_milliseconds());
if (cue_point.timestamp() > timestamp)
break;
prev_cue_point = &cue_point;
- index++;
}
TRY(iterator.seek_to_cue_point(*prev_cue_point));