Skip to content

Commit

Permalink
Clean up outdated references to "period-relative"
Browse files Browse the repository at this point in the history
Segment times and positions are no longer period-relative.

Issue #1339

Change-Id: If2b1b7d56ac49d50439598403f681a2da88ce605
  • Loading branch information
joeyparrish committed Mar 3, 2020
1 parent 8554539 commit 270a547
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions lib/media/segment_reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,16 @@ shaka.media.InitSegmentReference = class {
*/
shaka.media.SegmentReference = class {
/**
* @param {number} position The segment's position within a particular Period.
* The following should hold true between any two SegmentReferences from the
* same Period, r1 and r2:
* @param {number} position The segment's position.
* The following should hold true between any two SegmentReferences r1 and
* r2:
* IF r2.position > r1.position THEN
* [ (r2.startTime > r1.startTime) OR
* (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]
* @param {number} startTime The segment's start time in seconds, relative to
* the start of a particular Period.
* @param {number} endTime The segment's end time in seconds, relative to
* the start of a particular Period. The segment ends the instant before
* this time, so |endTime| must be strictly greater than |startTime|.
* @param {number} startTime The segment's start time in seconds.
* @param {number} endTime The segment's end time in seconds. The segment
* ends the instant before this time, so |endTime| must be strictly greater
* than |startTime|.
* @param {function():!Array.<string>} uris
* A function that creates the URIs of the resource containing the segment.
* @param {number} startByte The offset from the start of the resource to the
Expand All @@ -104,12 +103,16 @@ shaka.media.SegmentReference = class {
* are self-initializing.
* @param {number} timestampOffset
* The amount of time, in seconds, that must be added to the segment's
* internal timestamps to align it to the presentation timeline. This
* value should equal the Period start time minus the first presentation
* timestamp of the first frame/sample in the Period. For example, for MP4
* based streams, this value should equal Period start minus the first
* segment's tfdt box's 'baseMediaDecodeTime' field (after it has been
* converted to seconds).
* internal timestamps to align it to the presentation timeline.
* <br>
* For DASH, this value should equal the Period start time minus the first
* presentation timestamp of the first frame/sample in the Period. For
* example, for MP4 based streams, this value should equal Period start
* minus the first segment's tfdt box's 'baseMediaDecodeTime' field (after
* it has been converted to seconds).
* <br>
* For HLS, this value should be 0 to keep the presentation time at the most
* recent discontinuity minus the corresponding media time.
* @param {number} appendWindowStart
* The start of the append window for this reference, relative to the
* presentation. Any content from before this time will be removed by
Expand Down Expand Up @@ -160,7 +163,7 @@ shaka.media.SegmentReference = class {
}

/**
* Returns the segment's position within a particular Period.
* Returns the segment's position.
*
* @return {number} The segment's position.
* @export
Expand All @@ -170,8 +173,7 @@ shaka.media.SegmentReference = class {
}

/**
* Returns the segment's start time in seconds, relative to
* the start of a particular Period.
* Returns the segment's start time in seconds.
*
* @return {number}
* @export
Expand All @@ -181,8 +183,7 @@ shaka.media.SegmentReference = class {
}

/**
* Returns the segment's end time in seconds, relative to
* the start of a particular Period.
* Returns the segment's end time in seconds.
*
* @return {number}
* @export
Expand Down

0 comments on commit 270a547

Please sign in to comment.