Repository navigation
Conversation
The emergency switch-down candidate loop only compared bitrates, and its fallbacks used minAutoLevel directly. A level from another codec set could be selected, changing the audio or video codec mid-playback. Only consider levels with the codec set of the fragment being loaded, and keep that filter on the findBestLevel result and on the abort fallback. Added an AbrController case with a mixed codec ladder; it selects an avc1 level on the previous code and a hevc level after the change.
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...
Keep the emergency switch-down within the codec set of the fragment that is currently loading, instead of choosing a level by bitrate alone.
Why is this Pull Request needed?
_abandonRulesCheck()picks the next level bymaxBitrateonly. WhenfindBestLevel()rejects that candidate because of its codec set, the rejected level is still used, and the abort fallback goes tominAutoLevelregardless of codec set. On a ladder that mixes codec sets this can change the audio or video codec mid-playback and break the SourceBuffer, as reported in #8208.The candidate loop now skips levels whose
codecSetdiffers from the loading level, thefindBestLevel()result is only used when it keeps that codec set, and the abort fallback picks the lowest level in the same codec set.Are there any points in the code the reviewer needs to double check?
The filter uses
levels[loadingFragForLevel].codecSetbecause that is the stream being played, whilefindBestLevel()derives its codec set fromlastLoadedFragLevel. The two can differ after a switch, so the result is checked again before it is used.Resolves issues:
Fixes #8208
Checklist