diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 94570ee489..d7c393ccd7 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -1930,9 +1930,16 @@ shaka.hls.HlsParser = class { const mediaSequenceToStartTime = this.isLive_() ? this.mediaSequenceToStartTimeByType_.get(type) : new Map(); + const prevLowLatencyMode = this.lowLatencyMode_; const segments = this.createSegments_(verbatimMediaPlaylistUri, playlist, type, mimeType, mediaSequenceToStartTime, mediaVariables); + // This happens when autoLowLatencyMode is true, so we need set the + // correct lowLatencyPresentationDelay_ + if (prevLowLatencyMode != this.lowLatencyMode_) { + this.determinePresentationType_(playlist); + } + const lastEndTime = segments[segments.length - 1].endTime; /** @type {!shaka.media.SegmentIndex} */ const segmentIndex = new shaka.media.SegmentIndex(segments);