Repository navigation
fix: seek further back where the reader lands past the keyframe - #496
Merged
Merged
Conversation
MPEG-TS has no index, and FFmpeg's search by timestamp can land past the keyframe before the position, so playback started at the next keyframe, up to a whole GOP late. The player now seeks again further back until the first frame it decodes lies at or before the position.
devopvoid
added a commit
that referenced
this pull request
Oct 31, 2026
Keeps the seek further back of #496 for precise seeks only: a fast seek plays from the keyframe the reader lands on.
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.
In MPEG-TS, which has no index, FFmpeg's search by timestamp can land past the keyframe before the position, and playback started at the next keyframe, up to a whole GOP late (in a one-hour TS file, seek(59:08) started at 59:10). When the first frame decoded after a seek lies past the position with none before it, the player now seeks again 1, 2, 4… s further back (64 s at most), and stops where the reader no longer moves, as before the first picture. Adds a small MPEG-TS asset and tests for both cases.