Skip to content

Commit

Permalink
Fix error handling for GAP tags in subtitles or audio (#6478)
Browse files Browse the repository at this point in the history
  • Loading branch information
robwalch committed Jun 4, 2024
1 parent b3d1746 commit 61dd3f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/controller/error-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions src/controller/subtitle-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 61dd3f5

Please sign in to comment.