Skip to content

Commit

Permalink
Switch levels on Key and Fragment parsing errors or escalate to fatal…
Browse files Browse the repository at this point in the history
… error
  • Loading branch information
robwalch committed Nov 17, 2022
1 parent b73bde1 commit c415b28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/controller/level-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ export default class LevelController extends BasePlaylistController {
data.frag?.type === PlaylistLevelType.MAIN
? data.frag.level
: this.currentLevelIndex;
levelError = true;
// Do not retry level. Escalate to fatal if switching levels fails.
data.levelRetry = false;
break;
case ErrorDetails.LEVEL_LOAD_ERROR:
case ErrorDetails.LEVEL_LOAD_TIMEOUT:
Expand Down Expand Up @@ -444,6 +445,9 @@ export default class LevelController extends BasePlaylistController {
this.warn(`${errorDetails}: switch to ${nextLevel}`);
errorEvent.levelRetry = true;
this.hls.nextAutoLevel = nextLevel;
} else if (errorEvent.levelRetry === false) {
// No levels to switch to and no more retries
errorEvent.fatal = true;
}
}
}
Expand Down

0 comments on commit c415b28

Please sign in to comment.