ab0670dd by Tadej Novak Committed by David LaPalomento

Don't recalculate the live point if the translated index is the same as length

1 parent 9e0a6d2b
...@@ -1035,7 +1035,7 @@ videojs.Hls.translateMediaIndex = function(mediaIndex, original, update) { ...@@ -1035,7 +1035,7 @@ videojs.Hls.translateMediaIndex = function(mediaIndex, original, update) {
1035 // bitrate switches should be happening here. 1035 // bitrate switches should be happening here.
1036 translatedMediaIndex = (mediaIndex + (original.mediaSequence - update.mediaSequence)); 1036 translatedMediaIndex = (mediaIndex + (original.mediaSequence - update.mediaSequence));
1037 1037
1038 if (translatedMediaIndex >= update.segments.length || translatedMediaIndex < 0) { 1038 if (translatedMediaIndex > update.segments.length || translatedMediaIndex < 0) {
1039 // recalculate the live point if the streams are too far out of sync 1039 // recalculate the live point if the streams are too far out of sync
1040 return videojs.Hls.getMediaIndexForLive_(update) + 1; 1040 return videojs.Hls.getMediaIndexForLive_(update) + 1;
1041 } 1041 }
......