Skip to content

Commit

Permalink
Fix time range fudge value for Safari 9
Browse files Browse the repository at this point in the history
In Safari 8, the necessary fudge is 1us.
In Safari 9, the necessary fudge is 1us + 1femtosecond.
This makes the fudge value 0.1ms.

Change-Id: I7184c2d1c28ccbd93bac137d6617cbd8999bcfb9
  • Loading branch information
joeyparrish committed Feb 16, 2016
1 parent 4d79f76 commit 6ae1474
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/media/time_ranges_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ shaka.media.TimeRangesUtils.bufferedAheadOf = function(
if (!buffered) return 0;
// NOTE: On IE11, buffered ranges may show appended data before the associated
// append operation is complete.
var fudge = 0.000001; // 1us
// NOTE: The 1us fudge is needed on Safari, where removal up to X may leave a
// range which starts at X + 1us.
var fudge = 0.0001; // 0.1ms
// NOTE: The 0.1ms fudge is needed on Safari, where removal up to X may leave
// a range which starts at X + 1us + some small epsilon.
for (var i = 0; i < buffered.length; ++i) {
if (time + fudge >= buffered.start(i) && time < buffered.end(i)) {
return buffered.end(i) - time;
Expand Down

0 comments on commit 6ae1474

Please sign in to comment.