diff --git a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParser.java b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParser.java index 73a93052b8..fcd9a3e37b 100644 --- a/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParser.java +++ b/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParser.java @@ -820,6 +820,8 @@ private static HlsMediaPlaylist parseMediaPlaylist( if (METHOD_NONE.equals(method)) { currentSchemeDatas.clear(); cachedDrmInitData = null; + // To fix the playback issue on the mixed-ts-cmaf stream. + initializationSegment = null; } else /* !METHOD_NONE.equals(method) */ { fullSegmentEncryptionIV = parseOptionalStringAttr(line, REGEX_IV, variableDefinitions); if (KEYFORMAT_IDENTITY.equals(keyFormat)) { @@ -853,8 +855,6 @@ private static HlsMediaPlaylist parseMediaPlaylist( playlistDiscontinuitySequence = Integer.parseInt(line.substring(line.indexOf(':') + 1)); } else if (line.equals(TAG_DISCONTINUITY) && !discontinuityAfterSkip) { relativeDiscontinuitySequence++; - // To fix the playback issue on the mixed-ts-cmaf stream. - initializationSegment = null; } else if (line.startsWith(TAG_PROGRAM_DATE_TIME)) { segmentStartTimeUtcUs = Util.msToUs(Util.parseXsDateTime(line.substring(line.indexOf(':') + 1))); // Calc playlist start time with latest value of #EXT-X-PROGRAM-DATE-TIME tag, instead first value.