From 120e098f33e2c1e5699592ecc63957205892f94e Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Tue, 8 Jun 2021 14:57:58 -0400 Subject: [PATCH] Fix regression introduced in v1.0.6 (#3993) where subtitle track segment loading at position less than target duration only loads the first segment (only appears in streams with irregularly large target durations compared to segment duration) --- src/utils/buffer-helper.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/buffer-helper.ts b/src/utils/buffer-helper.ts index f656c8eb66b..415528adc51 100644 --- a/src/utils/buffer-helper.ts +++ b/src/utils/buffer-helper.ts @@ -91,6 +91,7 @@ export class BufferHelper { end: number; nextStart?: number; } { + pos = Math.max(0, pos); // sort on buffer.start/smaller end (IE does not always return sorted buffered range) buffered.sort(function (a, b) { const diff = a.start - b.start;