Skip to content

Commit 7e63cfd

Browse files
aveladjoeyparrish
authored andcommitted
fix: Avoid setAppendWindow when the window is Infinity (#7923)
1 parent 2e71610 commit 7e63cfd

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

lib/media/media_source_engine.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,20 +1309,24 @@ shaka.media.MediaSourceEngine = class {
13091309
null));
13101310
}
13111311
}
1312-
operations.push(this.enqueueOperation_(
1313-
contentType,
1314-
() => this.setAppendWindow_(
1315-
contentType, appendWindowStart, appendWindowEnd),
1316-
null));
1317-
if (this.needSplitMuxedContent_) {
1312+
if (appendWindowStart != 0 || appendWindowEnd != Infinity) {
13181313
operations.push(this.enqueueOperation_(
1319-
ContentType.AUDIO,
1314+
contentType,
13201315
() => this.setAppendWindow_(
1321-
ContentType.AUDIO, appendWindowStart, appendWindowEnd),
1316+
contentType, appendWindowStart, appendWindowEnd),
13221317
null));
1318+
if (this.needSplitMuxedContent_) {
1319+
operations.push(this.enqueueOperation_(
1320+
ContentType.AUDIO,
1321+
() => this.setAppendWindow_(
1322+
ContentType.AUDIO, appendWindowStart, appendWindowEnd),
1323+
null));
1324+
}
13231325
}
13241326

1325-
await Promise.all(operations);
1327+
if (operations.length) {
1328+
await Promise.all(operations);
1329+
}
13261330
}
13271331

13281332
/**

0 commit comments

Comments
 (0)