6f177803 by David LaPalomento

Remove timestampOffset

Playlist.duration() does a more comprehensive job of managing calculations with PTS values and discontinuities so remove reference on segmentParser.
1 parent 1cf59034
......@@ -31,15 +31,6 @@
// allow in-band metadata to be observed
self.metadataStream = new MetadataStream();
this.mediaTimelineOffset = null;
// The first timestamp value encountered during parsing. This
// value can be used to determine the relative timing between
// frames and the start of the current timestamp sequence. It
// should be reset to null before parsing a segment with
// discontinuous timestamp values from previous segments.
self.timestampOffset = null;
// For information on the FLV format, see
// http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf.
// Technically, this function returns the header and a metadata FLV tag
......@@ -360,13 +351,6 @@
// Skip past "optional" portion of PTS header
offset += pesHeaderLength;
// keep track of the earliest encounted PTS value so
// external parties can align timestamps across
// discontinuities
if (self.timestampOffset === null) {
self.timestampOffset = pts;
}
if (pid === self.stream.programMapTable[STREAM_TYPES.h264]) {
h264Stream.setNextTimeStamp(pts,
dts,
......
......@@ -890,13 +890,6 @@ videojs.Hls.prototype.drainBuffer = function(event) {
event = event || {};
// if this segment starts is the start of a new discontinuity
// sequence, the segment parser's timestamp offset must be
// re-calculated
if (segment.discontinuity) {
this.segmentParser_.timestampOffset = null;
}
// transmux the segment data from MP2T to FLV
this.segmentParser_.parseSegmentBinaryData(bytes);
this.segmentParser_.flushTags();
......
......@@ -104,8 +104,6 @@ var
return 'flv';
};
this.parseSegmentBinaryData = function() {};
this.timestampOffset = 0;
this.mediaTimelineOffset = 0;
this.flushTags = function() {};
this.tagsAvailable = function() {
return tags.length;
......@@ -1344,9 +1342,6 @@ test('translates ID3 PTS values to cue media timeline positions', function() {
openMediaSource(player);
player.hls.segmentParser_.parseSegmentBinaryData = function() {
// setup the timestamp offset
this.timestampOffset = tags[0].pts;
// trigger a metadata event
player.hls.segmentParser_.metadataStream.trigger('data', {
pts: 5 * 1000,
......@@ -1375,9 +1370,6 @@ test('translates ID3 PTS values across discontinuities', function() {
openMediaSource(player);
player.hls.segmentParser_.parseSegmentBinaryData = function() {
if (this.timestampOffset === null) {
this.timestampOffset = tags[0].pts;
}
// trigger a metadata event
if (events.length) {
player.hls.segmentParser_.metadataStream.trigger('data', events.shift());
......@@ -1395,7 +1387,6 @@ test('translates ID3 PTS values across discontinuities', function() {
'1.ts\n');
// segment 0 starts at PTS 14000 and has a cue point at 15000
player.hls.segmentParser_.timestampOffset = 14 * 1000;
tags.push({ pts: 14 * 1000, bytes: new Uint8Array(1) },
{ pts: 24 * 1000, bytes: new Uint8Array(1) });
events.push({
......