Skip to content

Commit

Permalink
fix(dash): Notify segments on all updates.
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 shaka-project#3675

Change-Id: I77ef00c5a86de9ebcb86f18f792084ed70f94e8d
  • Loading branch information
theodab committed Oct 28, 2021
1 parent 173ae42 commit b8b72a9
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
Expand Up @@ -66,9 +66,9 @@ shaka.dash.SegmentList = class {
const start = context.presentationTimeline.getSegmentAvailabilityStart();
segmentIndex.mergeAndEvict(references, start);
} else {
context.presentationTimeline.notifySegments(references);
segmentIndex = new shaka.media.SegmentIndex(references);
}
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
Expand Up @@ -120,9 +120,9 @@ shaka.dash.SegmentTemplate = class {
segmentIndex.mergeAndEvict(references,
context.presentationTimeline.getSegmentAvailabilityStart());
} else {
context.presentationTimeline.notifySegments(references);
segmentIndex = new shaka.media.SegmentIndex(references);
}
context.presentationTimeline.notifySegments(references);

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

0 comments on commit b8b72a9

Please sign in to comment.