From 724ebf65992320b363050f1880e096949229714c Mon Sep 17 00:00:00 2001 From: Tymoteusz Paszun Date: Tue, 28 Mar 2023 12:47:27 +0200 Subject: [PATCH] Remove fragments from FragmentTracker after transmux complete if fragment context changed --- src/controller/audio-stream-controller.ts | 1 + src/controller/stream-controller.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/controller/audio-stream-controller.ts b/src/controller/audio-stream-controller.ts index 94252a3f35f..2cdc82c39e0 100644 --- a/src/controller/audio-stream-controller.ts +++ b/src/controller/audio-stream-controller.ts @@ -744,6 +744,7 @@ class AudioStreamController // Check if the current fragment has been aborted. We check this by first seeing if we're still playing the current level. // If we are, subsequently check if the currently loading fragment (fragCurrent) has changed. if (this.fragContextChanged(frag) || !details) { + this.fragmentTracker.removeFragment(frag); return; } diff --git a/src/controller/stream-controller.ts b/src/controller/stream-controller.ts index acf21fc1454..49534c7c6a6 100644 --- a/src/controller/stream-controller.ts +++ b/src/controller/stream-controller.ts @@ -1060,6 +1060,7 @@ export default class StreamController // Check if the current fragment has been aborted. We check this by first seeing if we're still playing the current level. // If we are, subsequently check if the currently loading fragment (fragCurrent) has changed. if (this.fragContextChanged(frag)) { + this.fragmentTracker.removeFragment(frag); return; }