Skip to content

Commit

Permalink
level-controller: avoid LEVEL_SWITCH_ERROR reporting in case of setti…
Browse files Browse the repository at this point in the history
…ng hls.loadLevel to -1
  • Loading branch information
mangui committed Jul 9, 2015
1 parent 6759164 commit ccb9f03
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/controller/level-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@

set manualLevel(newLevel) {
this._manualLevel = newLevel;
this.level = newLevel;
if(newLevel !==-1) {
this.level = newLevel;
}
}

/** Return the capping/max level value that could be used by automatic level selection algorithm **/
Expand Down Expand Up @@ -181,19 +183,21 @@
}

onError(event,data) {
var details = data.details,fatal=data.fatal;
// try to recover not fatal errors
switch(data.details) {
switch(details) {
case ErrorDetails.FRAG_LOAD_ERROR:
case ErrorDetails.FRAG_LOAD_TIMEOUT:
if(!data.fatal) {
logger.log(`level controller,${data.details}: emergency switch-down for next fragment`);
case ErrorDetails.FRAG_LOOP_LOADING_ERROR:
if(!fatal) {
logger.log(`level controller,${details}: emergency switch-down for next fragment`);
this.lastbw = 0;
this.lastfetchduration = 0;
}
break;
case ErrorDetails.LEVEL_LOAD_ERROR:
case ErrorDetails.LEVEL_LOAD_TIMEOUT:
if(data.fatal) {
if(fatal) {
this._level = undefined;
}
break;
Expand Down

0 comments on commit ccb9f03

Please sign in to comment.