Skip to content

Commit

Permalink
fix: Avoid setAppendWindow when the window is Infinity (#7923)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Jan 23, 2025
1 parent 63ed568 commit 2801876
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/media/media_source_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1301,20 +1301,24 @@ shaka.media.MediaSourceEngine = class {
null));
}
}
operations.push(this.enqueueOperation_(
contentType,
() => this.setAppendWindow_(
contentType, appendWindowStart, appendWindowEnd),
null));
if (this.needSplitMuxedContent_) {
if (appendWindowStart != 0 || appendWindowEnd != Infinity) {
operations.push(this.enqueueOperation_(
ContentType.AUDIO,
contentType,
() => this.setAppendWindow_(
ContentType.AUDIO, appendWindowStart, appendWindowEnd),
contentType, appendWindowStart, appendWindowEnd),
null));
if (this.needSplitMuxedContent_) {
operations.push(this.enqueueOperation_(
ContentType.AUDIO,
() => this.setAppendWindow_(
ContentType.AUDIO, appendWindowStart, appendWindowEnd),
null));
}
}

await Promise.all(operations);
if (operations.length) {
await Promise.all(operations);
}
}

/**
Expand Down

0 comments on commit 2801876

Please sign in to comment.