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.
Description
Sometimes when we're switching timelines, we run into a situation where the buffer is starved due to the main or audio trying to switch to separate timelines.
shouldWaitForTimelineChange
is called when deciding whether to wait to load or append the current segment. The conditions for this to returnfalse
are:With certain live media, sometimes we'll change playlists (ABR, track change, manual quality switch) during a timeline change. This playlist change, causes a new request for a variant playlist that playlist isn't guaranteed to be the next timeline that the other loader is currently pending. For example:
On a quality change, the main segment loader is moving to an older timeline because the new variant is slightly behind.
This causes the loader to get stuck waiting for the other loader to sync up for a timelineChange which never happens and eventually stalls playback.
Specific Changes proposed
Add checks in the loader to look for bad timeline changes, instances such as this where the loaders are both pending timeline changes to separate timelines and resetting the loader when those cases occur, in order to re-sync timelines and avoid a stall.
Requirements Checklist