Skip to content

fix: seek further back where the reader lands past the keyframe - #496

Merged
devopvoid merged 1 commit into
mainfrom
fix/ts-seek
Oct 31, 2026
Merged

devopvoid merged 1 commit into
mainfrom
fix/ts-seek

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

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.

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
devopvoid merged commit 2945560 into main Oct 31, 2026
38 of 40 checks passed
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.
@devopvoid
devopvoid deleted the fix/ts-seek branch November 1, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant