Repository navigation
Conversation
MatroskaExtractor seeks to the Cues position named by a SeekHead when it reaches the first Cluster, and trusted that position. If it held another element, the extractor read on from there. From a position at or before a Cluster it requested the same seek again without end, with no SeekMap or samples output. From other positions it output nothing or failed to parse. If the position was at or beyond the end of the input, as in a file cut off before its Cues, the data source rejected the seek and the file did not prepare. The extractor now checks that the named position holds the Cues before reading them. If it holds anything else, or is at or beyond a known input length, the extractor outputs an unseekable SeekMap, as for a file without Cues, and plays the file from where it left off. A position beyond the end of an input of unknown length is still rejected by the data source before the extractor can read again. A reference to a position from which reading on happened to reach the Cues used to be seekable and is now unseekable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Matroska files whose
SeekHeadpointsCuesto another element or past the end of the file hang or fail to prepare in ExoPlayer.MatroskaExtractornow validates that theCuesposition is within a known input length and actually starts withID_CUESbefore reading it.Previously,
MatroskaExtractorsought to theCuesoffset unconditionally at the firstCluster. If that offset held aCluster(or preceded one), the extractor kept requesting the same seek forever with noSeekMapor samples output. If it was at or past EOF (for example in a truncated file), the data source rejected the seek and playback failed. Now the extractor outputs an unseekableSeekMapand resumes playback from where it left off.Known limits
Cuesoffset past EOF on an input of unknown length is still rejected by the data source before the extractor can read again.Cuesreference from which reading forward happened to reach the realCuesused to be seekable and is now unseekable.Device testing
Tested in the demo app on an NVIDIA Shield TV Pro 2019 (Android 11):
Cuespointing to aClusterCuespast EOF / file truncated beforeCuesCuesFound via @FongMi's review of #3588.