Commit f749488 1 parent dda56e9 commit f749488 Copy full SHA for f749488
File tree 3 files changed +14
-7
lines changed
3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ import type {
37
37
KeyLoadedData ,
38
38
MediaAttachingData ,
39
39
BufferFlushingData ,
40
- LevelSwitchingData ,
41
40
ManifestLoadedData ,
42
41
} from '../types/events' ;
43
42
import type { FragmentTracker } from './fragment-tracker' ;
@@ -356,7 +355,6 @@ export default class BaseStreamController
356
355
// if we're here we probably needed to backtrack or are waiting for more parts
357
356
return ;
358
357
}
359
- level . fragmentError = 0 ;
360
358
const state = this . state ;
361
359
if ( this . fragContextChanged ( frag ) ) {
362
360
if (
@@ -1520,10 +1518,21 @@ export default class BaseStreamController
1520
1518
} ,
1521
1519
false
1522
1520
) ;
1523
- if ( ! parsed ) {
1524
- this . warn (
1521
+ if ( parsed ) {
1522
+ level . fragmentError = 0 ;
1523
+ } else {
1524
+ const error = new Error (
1525
1525
`Found no media in fragment ${ frag . sn } of level ${ level . id } resetting transmuxer to fallback to playlist timing`
1526
1526
) ;
1527
+ this . warn ( error . message ) ;
1528
+ this . hls . trigger ( Events . ERROR , {
1529
+ type : ErrorTypes . MEDIA_ERROR ,
1530
+ details : ErrorDetails . FRAG_PARSING_ERROR ,
1531
+ fatal : false ,
1532
+ error,
1533
+ frag,
1534
+ reason : `Found no media in msn ${ frag . sn } of level "${ level . url } "` ,
1535
+ } ) ;
1527
1536
this . resetTransmuxer ( ) ;
1528
1537
}
1529
1538
this . state = State . PARSED ;
Original file line number Diff line number Diff line change @@ -94,8 +94,7 @@ export default class ErrorController {
94
94
case ErrorDetails . FRAG_PARSING_ERROR :
95
95
case ErrorDetails . FRAG_DECRYPT_ERROR : {
96
96
const levelIndex = this . getVariantLevelIndex ( data . frag ) ;
97
- // Do not retry level. Escalate to fatal if switching levels fails.
98
- data . levelRetry = false ;
97
+ // Switch level if possible, otherwise allow retry count to reach max error retries
99
98
this . levelSwitch ( data , levelIndex ) ;
100
99
return ;
101
100
}
Original file line number Diff line number Diff line change @@ -445,7 +445,6 @@ export default class LevelController extends BasePlaylistController {
445
445
if ( frag !== undefined && frag . type === PlaylistLevelType . MAIN ) {
446
446
const level = this . _levels [ frag . level ] ;
447
447
if ( level !== undefined ) {
448
- level . fragmentError = 0 ;
449
448
level . loadError = 0 ;
450
449
}
451
450
}
You can’t perform that action at this time.
0 commit comments