Fix HLS chunkful preparation bug affecting certain master playlists

The bug affects playlists that start with an I-FRAME only variant.

Issue: #8025
PiperOrigin-RevId: 335819497
This commit is contained in:
aquilescanta 2020-10-07 10:02:42 +01:00 committed by Oliver Woodman
parent 837cdc4f67
commit 5b0b4479ae
2 changed files with 7 additions and 1 deletions

View file

@ -37,6 +37,10 @@
* Add the option to sort tracks by `Format` in `TrackSelectionView` and
`TrackSelectionDialogBuilder`
([#7709](https://github.com/google/ExoPlayer/issues/7709)).
* HLS:
* Fix crash affecting chunkful preparation of master playlists that start
with an I-FRAME only variant
([#8025](https://github.com/google/ExoPlayer/issues/8025)).
* IMA extension:
* Fix position reporting after fetch errors
([#7956](https://github.com/google/ExoPlayer/issues/7956)).

View file

@ -592,7 +592,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
public InitializationTrackSelection(TrackGroup group, int[] tracks) {
super(group, tracks);
selectedIndex = indexOf(group.getFormat(0));
// The initially selected index corresponds to the first EXT-X-STREAMINF tag in the master
// playlist.
selectedIndex = indexOf(group.getFormat(tracks[0]));
}
@Override