Repository navigation
Conversation
Prefer the next fragment on level switch when it starts within 1/200s of the end of the buffer. Keep lookup tolerance when waiting for level details resets startFragRequested and a previous fragment is still tracked. Fixes video-dev#8179 Related to video-dev#6441 and video-dev#6471
robwalch
reviewed
Nov 17, 2026
robwalch
left a comment
Collaborator
There was a problem hiding this comment.
I'd prefer if this were based on playlist times aligning, or some yet to be determined signal in HLS that segment boundaries are aligned, rather than lookup tolerance.
I do not think this should be configurable such that playback only works when configured one way vs another.
Alternatively, once the overlapping segment is parsed can it be determined that it should not be appended and just move on to the next?
This branch has not been deployed
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...
Extend the existing next-fragment preference across level switches, in either direction and beyond the first fragment. The switch allowance remains
Math.min(nextFragLookupTolerance, maxFragLookUpTolerance), with the existing 1/200s default.Keep lookup tolerance enabled when waiting for level details resets
startFragRequestedbut a previous fragment is still tracked.Why is this Pull Request needed?
See #8179. After a level switch, the fragment that was just buffered is loaded again in the new level and appended over the buffered range, because the buffer ends a few microseconds before the end of that fragment.
Waiting for level details resets
startFragRequested, which has disabled lookup tolerance on the next fragment selection since v1.6.0, including the 1/200s allowance from #6471. With the stream from #6441 andstartLevel: 2:With this change and the test stream from #8179 (network and CPU throttled), sn 1 and sn 2 are each loaded once.
Are there any points in the code the reviewer needs to double check?
Resolves issues:
Resolves #8179
Related to #6441 and #6471.
Checklist