Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Low-Latency HLS next part selection when switching mid segment #5122

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

robwalch
Copy link
Collaborator

This PR will...

Fix an issue in nextPartIndex where the first independent part index is returned after newer parts have been loaded, but the next part needed is not yet listed.

Why is this Pull Request needed?

Instead of waiting for the next needed part, the player was selecting the first part, then skipping the ones that were loaded, leading to freezing of video or stalling of playback.

Are there any points in the code the reviewer needs to double check?

No

Resolves issues:

Fixes #5111

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

… been loaded and next part is not listed

Fixes #5111
@erankor
Copy link
Collaborator

erankor commented Dec 21, 2022

Had to go over it a few times to understand... :)

So, essentially:

  • if nextPart is positive, targetBufferTime must be >= part.start (otherwise it would break out of the loop). And, in this case, we surely don't want to load the index currently set in nextPart, because the current index i (that was already loaded) is surely a better fit
  • if nextPart is already negative, this change has no effect, so that's fine as well

Looks good to me.

@robwalch robwalch merged commit 7e419d5 into master Dec 21, 2022
@robwalch robwalch deleted the bugfix/llhls-next-part branch December 21, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Video freezes on rendition switch in LLHLS
2 participants