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( diff --git a/src/controller/subtitle-stream-controller.ts b/src/controller/subtitle-stream-controller.ts index edc0e553788..2f5c573bd63 100644 --- a/src/controller/subtitle-stream-controller.ts +++ b/src/controller/subtitle-stream-controller.ts @@ -204,6 +204,9 @@ export class SubtitleStreamController const frag = data.frag; if (frag?.type === PlaylistLevelType.SUBTITLE) { + if (data.details === ErrorDetails.FRAG_GAP) { + this.fragmentTracker.fragBuffered(frag, true); + } if (this.fragCurrent) { this.fragCurrent.abortRequests(); }