Skip to content

Commit

Permalink
fix(dash): fix race condition in segment template (#5842)
Browse files Browse the repository at this point in the history
Fixes #5760
friday authored Nov 2, 2023
1 parent ceaa9fa commit 8d2b657
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/dash/segment_template.js
Original file line number Diff line number Diff line change
@@ -813,18 +813,16 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
let ref = this.references[correctedPosition];

if (!ref) {
const mediaTemplate = this.templateInfo_.mediaTemplate;
const range = this.templateInfo_.timeline[correctedPosition];
const segmentReplacement = position + this.templateInfo_.startNumber;
const timeReplacement = this.templateInfo_
.unscaledPresentationTimeOffset + range.unscaledStart;

const createUrisCb = () => {
if (!this.templateInfo_) {
return [];
}
return shaka.dash.TimelineSegmentIndex
.createUris_(
this.templateInfo_.mediaTemplate,
mediaTemplate,
this.representationId_,
segmentReplacement,
this.bandwidth_,

0 comments on commit 8d2b657

Please sign in to comment.