From 82f6bacd2f5161f823595283768cb8a4d28baedc Mon Sep 17 00:00:00 2001 From: Jacob Trimble Date: Wed, 15 Mar 2017 10:23:13 -0700 Subject: [PATCH] Don't use PTO in SegmentList with duration. 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 --- lib/dash/segment_list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dash/segment_list.js b/lib/dash/segment_list.js index ef4194accb..2c059b809e 100644 --- a/lib/dash/segment_list.js +++ b/lib/dash/segment_list.js @@ -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;