Skip to content

Commit

Permalink
Don't use PTO in SegmentList with duration.
Browse files Browse the repository at this point in the history
The presentationTimeOffset attribute is used to adjust the start time
of segments to the DASH timeline.  For example, if the first segment
starts at 10s, then this attribute can be used to make it start at 0.
Normally, the times in the manifest should match the times in the
segments.  So we should use PTO on the times in the manifest.

However, for SegmentList with duration we shouldn't actually use it.
According to DASH sec. 7.2.1, the MPD start time (which is approximately
the presentation time) is after PTO is applied.  In sec. 5.3.9.5.3,
when using the duration attribute, the MPD start time is calculated
from the duration (as we do).  So that time already has PTO applied.

Change-Id: I8ac3befec8a8b0cbe8dda48f5c5888e1122c5d62
  • Loading branch information
TheModMaker committed Mar 15, 2017
1 parent a3d6186 commit 82f6bac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dash/segment_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ shaka.dash.SegmentList.parseSegmentListInfo_ = function(context) {

var startTime = 0;
if (segmentInfo.segmentDuration) {
// Consider the presentationTimeOffset
startTime = segmentInfo.segmentDuration * (startNumber - 1) -
segmentInfo.presentationTimeOffset;
// See DASH sec. 5.3.9.5.3
// Don't use presentationTimeOffset for @duration.
startTime = segmentInfo.segmentDuration * (startNumber - 1);
} else if (segmentInfo.timeline && segmentInfo.timeline.length > 0) {
// The presentationTimeOffset was considered in timeline creation
startTime = segmentInfo.timeline[0].start;
Expand Down

0 comments on commit 82f6bac

Please sign in to comment.