Skip to content

Commit

Permalink
stream-controller: _ensureFragmentAtLivePoint() add frag look up tole…
Browse files Browse the repository at this point in the history
…rance when checking if end of buffer is within authorized latency

this avoids seeking to liveSyncDuration when seeking to 0, in case level.start = 0.0xx (level.start > 0)
  • Loading branch information
mangui committed Feb 9, 2017
1 parent adbcb35 commit 7db86ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class StreamController extends EventHandler {
//logger.log(`start/pos/bufEnd/seeking:${start.toFixed(3)}/${pos.toFixed(3)}/${bufferEnd.toFixed(3)}/${this.media.seeking}`);
let maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount*levelDetails.targetduration;

if (bufferEnd < Math.max(start, end - maxLatency)) {
if (bufferEnd < Math.max(start-config.maxFragLookUpTolerance, end - maxLatency)) {
let liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);
logger.log(`buffer end: ${bufferEnd.toFixed(3)} is located too far from the end of live sliding playlist, reset currentTime to : ${liveSyncPosition.toFixed(3)}`);
bufferEnd = liveSyncPosition;
Expand Down

0 comments on commit 7db86ae

Please sign in to comment.