Skip to content

Commit

Permalink
fix(HLS): Fix lowLatencyPresentationDelay when using autoLowLatencyMo…
Browse files Browse the repository at this point in the history
…de (#4712)

Backported to v3.3.x
  • Loading branch information
avelad authored and joeyparrish committed Dec 8, 2022
1 parent f9121b5 commit a9bb695
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,7 @@ shaka.hls.HlsParser = class {
*/
const discontinuityToMediaSequence = new Map();

const prevLowLatencyMode = this.lowLatencyMode_;
let segments;
try {
segments = await this.createSegments_(verbatimMediaPlaylistUri,
Expand All @@ -1508,6 +1509,12 @@ shaka.hls.HlsParser = class {
throw error;
}

// This happens when autoLowLatencyMode is true, so we need set the
// correct lowLatencyPresentationDelay_
if (prevLowLatencyMode != this.lowLatencyMode_) {
this.determinePresentationType_(playlist);
}

const minTimestamp = segments[0].startTime;
const lastEndTime = segments[segments.length - 1].endTime;
/** @type {!shaka.media.SegmentIndex} */
Expand Down

0 comments on commit a9bb695

Please sign in to comment.