Fix seeking back in live with timestamp wrapping (1.6.6 regression) - #7537
Merged
Conversation
robwalch
marked this pull request as draft
September 11, 2025 18:16
robwalch
force-pushed
the
bugfix/init-pts-below-zero
branch
2 times, most recently
from
September 11, 2025 23:39
4fd8026 to
b5ce1f7
Compare
robwalch
marked this pull request as ready for review
September 11, 2025 23:41
robwalch
force-pushed
the
bugfix/init-pts-below-zero
branch
from
September 12, 2025 00:00
b5ce1f7 to
780b883
Compare
3 tasks
3 tasks
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.
This PR will...
Advance initPTS to accommodate timestamps in earlier segments when starting late in the timeline.
Why is this Pull Request needed?
When starting long running live streams without discontinuities, timestamps may have already wrapped in the past. This change anticipates that so that initPTS is not set to a value that would result in earlier segments timestamps getting unwrapped backwards to a value less than zero.
This issue did not occur prior to v1.6.6 with #7311, since in those older versions PTS was always remapped to the timeline. Now that PTS is preserved, it needs to be unwrapped if the timeline is long enough that a low starting "initPTS" would result in negative timestamps when seeking back.
Are there any points in the code the reviewer needs to double check?
Resolves issues:
Fixes #7536
Checklist