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

Adjust initial selection of HlsChunckSource.InitializationTrackSelection #8025

Closed
wants to merge 1 commit into from
Closed

Adjust initial selection of HlsChunckSource.InitializationTrackSelection #8025

wants to merge 1 commit into from

Conversation

matamegger
Copy link
Contributor

With the changes done in 0670782, there exists the possibility that indexOf(group.getFormat(0)) returns -1 (i.e. the track is not part of the selection).
This will earlier or later result in an ArrayIndexOutOfBoundsException.*

After having a look at the BaseTrackSelection I assumed that the selectedIndex may not be -1 or in general any invalid index for the selection.
To always have a valid selection we just select the first one. (Which is basically equivalent to the previous behaviour if the above mentioned change was not implemented.)


* I observed the exception in the updateSelectedTrack -> isBlacklisted call

@google-cla google-cla bot added the cla: yes label Oct 1, 2020
@AquilesCanta AquilesCanta self-assigned this Oct 1, 2020
@AquilesCanta
Copy link
Contributor

I think the described behavior may happen when the master playlist's first stream-inf tag is an i-frame-only tag.

The fix looks good, but it introduces a (I assume involuntary) functional change: It will make preparation start with the lowest bitrate variant, which changes the historical ExoPlayer bevahior of choosing the first stream-inf in the master playlist. I think it could make sense to choose the lowest bitrate one, as a way to speed up preparation. But there are better ways of achieving this, so it's a change that should be analysed independently of this bugfix.

Thanks for reporting this. I will send a fix for this internally, since it's faster than us having a back and forth to get this merged.

kim-vde pushed a commit that referenced this pull request Oct 13, 2020
The bug affects playlists that start with an I-FRAME only variant.

Issue: #8025
PiperOrigin-RevId: 335819497
ojw28 pushed a commit that referenced this pull request Oct 21, 2020
The bug affects playlists that start with an I-FRAME only variant.

Issue: #8025
PiperOrigin-RevId: 335819497
@matamegger matamegger deleted the feature/fix_invalid_selection_index_in_initialization_track_selection branch November 6, 2020 14:35
@google google locked and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants