diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7b7b842dfd4..2b460aa4a9c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -51,6 +51,10 @@ ([#7988](https://github.com/google/ExoPlayer/issues/7988)). * Ignore negative payload size in PES packets ([#8005](https://github.com/google/ExoPlayer/issues/8005)). +* 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)). diff --git a/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java b/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java index 530d56fa9c8..2ab4852339b 100644 --- a/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java +++ b/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java @@ -592,7 +592,9 @@ private static final class InitializationTrackSelection extends BaseTrackSelecti 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