mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
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.
This commit is contained in:
parent
448d121304
commit
1f650088a0
Notes:
sideshowbarker
2024-07-17 00:36:29 +09:00
Author: https://github.com/Zaggy1024
Commit: 1f650088a0
Pull-request: https://github.com/SerenityOS/serenity/pull/17364
1 changed files with 1 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue