mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-16 16:16:40 +03:00
Always apply timestamp correction to OPT.
Closes #200 Change-Id: I821d7a8336cc66593665dbc2ad794adc3fb55918
This commit is contained in:
committed by
Gerrit Code Review
parent
151936c6be
commit
62adcd40c1
@@ -255,23 +255,27 @@ shaka.dash.LiveSegmentIndex.prototype.correct = function(timestampCorrection) {
|
||||
var delta = shaka.media.SegmentIndex.prototype.correct.call(
|
||||
this, timestampCorrection);
|
||||
|
||||
var max = Math.min.apply(null,
|
||||
this.references
|
||||
.filter(function(a) { return a.endTime != null; })
|
||||
.map(function(a) { return a.endTime - a.startTime; }));
|
||||
if (Math.abs(delta) > max) {
|
||||
// A timestamp correction should be less than the duration of any one
|
||||
// segment in the stream.
|
||||
shaka.log.warning(
|
||||
'Timestamp correction (' + timestampCorrection + ')',
|
||||
'is unreasonably large for live content.',
|
||||
'The content may have errors in it.');
|
||||
}
|
||||
|
||||
if (this.originalPresentationTime_ != null) {
|
||||
shaka.asserts.assert(this.originalLiveEdge_ != null);
|
||||
shaka.asserts.assert(this.seekStartTime_ != null);
|
||||
|
||||
this.originalLiveEdge_ += delta;
|
||||
this.seekStartTime_ += delta;
|
||||
this.originalPresentationTime_ += delta;
|
||||
|
||||
if (this.originalLiveEdge_ > this.originalPresentationTime_) {
|
||||
// A timestamp correction should be less than the duration of any one
|
||||
// segment in the stream. So, the live-edge should not surpass the
|
||||
// current presentation time, but if it does then try to recover.
|
||||
shaka.log.warning(
|
||||
'Timestamp correction (' + timestampCorrection + ')',
|
||||
'is unreasonably large for live content.',
|
||||
'The content may have errors in it.');
|
||||
this.originalPresentationTime_ += delta;
|
||||
}
|
||||
shaka.asserts.assert(this.originalLiveEdge_ <=
|
||||
this.originalPresentationTime_);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user