-
Notifications
You must be signed in to change notification settings - Fork 708
Bugfix: Handle seekhead for cues on mkv files. #2268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
ffca82f
3a79ac2
04c8b3d
f5a6ed0
a77bd28
73a79cb
3525b89
705b31d
5ee7bd2
46f72f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -749,6 +749,13 @@ protected void startMasterElement(int id, long contentPosition, long contentSize | |
| throw ParserException.createForMalformedContainer( | ||
| "Multiple Segment elements not supported", /* cause= */ null); | ||
| } | ||
|
|
||
| // If we have to reparse due to an IO exception we also have to clear the seek head data | ||
| visitedSeekHeads.clear(); | ||
| pendingSeekHeads.clear(); | ||
| seekPositionAfterSeekingForHead = C.INDEX_UNSET; | ||
| seekForSeekContent = false; | ||
|
|
||
| segmentContentPosition = contentPosition; | ||
| segmentContentSize = contentSize; | ||
| break; | ||
|
|
@@ -846,7 +853,10 @@ protected void endMasterElement(int id) throws ParserException { | |
| } else if (seekEntryId == ID_SEEK_HEAD) { | ||
| // We have a set here to prevent inf recursion, only if this seek head is non | ||
| // visited we add it. VLC limits this to 10, but this should work equally as well. | ||
| if (visitedSeekHeads.add(seekEntryPosition)) { | ||
| // | ||
| // Note that we also need to check that we do not jump before or to the segment we are on | ||
| // as we do not want to clear our visitedSeekHeads | ||
| if (visitedSeekHeads.add(seekEntryPosition) && seekEntryPosition > segmentContentPosition) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIUC it's not valid for the In that case, it seems reasonable to trust that both the |
||
| pendingSeekHeads.add(seekEntryPosition); | ||
| } | ||
| } else if (seekEntryId == ID_CUES) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not obvious to me how you know that you've encountered an I/O exception if you land here
Is this the clearing logic I suggested maybe belongs in
MatroskaExtractor.seek()in #2268 (comment)?