From cff7e7b0bf79d3440dda66a9286493d6bccb47f6 Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Mon, 3 Jun 2024 16:13:52 -0700 Subject: [PATCH 1/3] Fix error handling switches levels on GAP tag in rendition playlist with no alternate Related to #6475 --- src/controller/error-controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controller/error-controller.ts b/src/controller/error-controller.ts index bc6f8810b95..c609d1fdd1e 100644 --- a/src/controller/error-controller.ts +++ b/src/controller/error-controller.ts @@ -381,7 +381,11 @@ export default class ErrorController implements NetworkComponentAPI { ) { const levelCandidate = levels[candidate]; // Skip level switch if GAP tag is found in next level at same position - if (errorDetails === ErrorDetails.FRAG_GAP && data.frag) { + if ( + errorDetails === ErrorDetails.FRAG_GAP && + fragErrorType === PlaylistLevelType.MAIN && + data.frag + ) { const levelDetails = levels[candidate].details; if (levelDetails) { const fragCandidate = findFragmentByPTS( From 400a79851a6db9b1f5a71ea1541e8ca46c0872c4 Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Mon, 3 Jun 2024 16:28:59 -0700 Subject: [PATCH 2/3] Mark gap frag as loaded --- src/controller/subtitle-stream-controller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controller/subtitle-stream-controller.ts b/src/controller/subtitle-stream-controller.ts index edc0e553788..78f9091f7fa 100644 --- a/src/controller/subtitle-stream-controller.ts +++ b/src/controller/subtitle-stream-controller.ts @@ -204,6 +204,10 @@ export class SubtitleStreamController const frag = data.frag; if (frag?.type === PlaylistLevelType.SUBTITLE) { + if (data.details === ErrorDetails.FRAG_GAP) { + this.fragmentTracker.fragBuffered(frag, true); + return; + } if (this.fragCurrent) { this.fragCurrent.abortRequests(); } From 1258be741639303e4168c346fc4690a628a77891 Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Mon, 3 Jun 2024 17:19:22 -0700 Subject: [PATCH 3/3] Reset loading after gap error --- src/controller/subtitle-stream-controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/controller/subtitle-stream-controller.ts b/src/controller/subtitle-stream-controller.ts index 78f9091f7fa..2f5c573bd63 100644 --- a/src/controller/subtitle-stream-controller.ts +++ b/src/controller/subtitle-stream-controller.ts @@ -206,7 +206,6 @@ export class SubtitleStreamController if (frag?.type === PlaylistLevelType.SUBTITLE) { if (data.details === ErrorDetails.FRAG_GAP) { this.fragmentTracker.fragBuffered(frag, true); - return; } if (this.fragCurrent) { this.fragCurrent.abortRequests();