Don't recalculate the live point if the translated index is the same as length
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment