Skip to content

Commit

Permalink
fix(dash): Fix seek range issues on transition from live to VOD
Browse files Browse the repository at this point in the history
Before, when using SegmentTemplate or SegmentList, we would tell
the presentation timeline about new segments only when we saw a
new period or representation. This meant that, in live streams,
if new content was being added to the SegmentTemplate or SegmentList,
the presentation timeline was not being kept abreast of the changes.
Thus, if that stream were to then transition to VOD, the presentation
timeline would suddenly start to report that the current time was
beyond the end of the seek range, which caused playback to stop.

Closes #3675

Change-Id: I77ef00c5a86de9ebcb86f18f792084ed70f94e8d
  • Loading branch information
theodab authored and joeyparrish committed Jan 5, 2022
1 parent 6078f26 commit 30efd0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dash/segment_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ shaka.dash.SegmentList = class {
const start = context.presentationTimeline.getSegmentAvailabilityStart();
segmentIndex.mergeAndEvict(references, start);
} else {
context.presentationTimeline.notifySegments(references);
segmentIndex = new shaka.media.SegmentIndex(references);
if (id && context.dynamic) {
segmentIndexMap[id] = segmentIndex;
}
}
context.presentationTimeline.notifySegments(references);

if (!context.dynamic || !context.periodInfo.isLastPeriod) {
const periodStart = context.periodInfo.start;
Expand Down
2 changes: 1 addition & 1 deletion lib/dash/segment_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ shaka.dash.SegmentTemplate = class {
segmentIndex.mergeAndEvict(references,
context.presentationTimeline.getSegmentAvailabilityStart());
} else {
context.presentationTimeline.notifySegments(references);
segmentIndex = new shaka.media.SegmentIndex(references);
if (id && context.dynamic) {
segmentIndexMap[id] = segmentIndex;
}
}
context.presentationTimeline.notifySegments(references);

if (shouldFit) {
segmentIndex.fit(periodStart, periodEnd);
Expand Down

0 comments on commit 30efd0f

Please sign in to comment.