Commit 2536222f by olly Committed by Oliver Woodman

HLS: Fix issue where new init segment would not be loaded

Issue: #9004
#minor-release
PiperOrigin-RevId: 379516815
parent d68dba6e
...@@ -58,6 +58,11 @@ ...@@ -58,6 +58,11 @@
is set incorrectly is set incorrectly
([#4083](https://github.com/google/ExoPlayer/issues/4083)). Such content ([#4083](https://github.com/google/ExoPlayer/issues/4083)). Such content
is malformed and should be re-encoded. is malformed and should be re-encoded.
* HLS:
* Fix issue where a new initialization segment, as specified by an
`EXT-X-MAP` tag in a media playlist, would not be loaded when
encountered during playback
([#9004](https://github.com/google/ExoPlayer/issues/9004)).
* Ad playback: * Ad playback:
* Support changing ad break positions in the player logic * Support changing ad break positions in the player logic
([#5067](https://github.com/google/ExoPlayer/issues/5067). ([#5067](https://github.com/google/ExoPlayer/issues/5067).
......
...@@ -137,12 +137,19 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -137,12 +137,19 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
ParsableByteArray scratchId3Data; ParsableByteArray scratchId3Data;
if (previousChunk != null) { if (previousChunk != null) {
boolean isSameInitData =
initDataSpec == previousChunk.initDataSpec
|| (initDataSpec != null
&& previousChunk.initDataSpec != null
&& initDataSpec.uri.equals(previousChunk.initDataSpec.uri)
&& initDataSpec.position == previousChunk.initDataSpec.position);
boolean isFollowingChunk = boolean isFollowingChunk =
playlistUrl.equals(previousChunk.playlistUrl) && previousChunk.loadCompleted; playlistUrl.equals(previousChunk.playlistUrl) && previousChunk.loadCompleted;
id3Decoder = previousChunk.id3Decoder; id3Decoder = previousChunk.id3Decoder;
scratchId3Data = previousChunk.scratchId3Data; scratchId3Data = previousChunk.scratchId3Data;
previousExtractor = previousExtractor =
isFollowingChunk isSameInitData
&& isFollowingChunk
&& !previousChunk.extractorInvalidated && !previousChunk.extractorInvalidated
&& previousChunk.discontinuitySequenceNumber == discontinuitySequenceNumber && previousChunk.discontinuitySequenceNumber == discontinuitySequenceNumber
? previousChunk.extractor ? previousChunk.extractor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment