Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mangui committed Jun 9, 2016
1 parent dc3bb03 commit d797585
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/controller/abr-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ class AbrController extends EventHandler {

get nextAutoLevel() {
let hls = this.hls,
config = hls.config,
levels = hls.levels,
v = hls.media,
playbackRate = ((v && v.playbackRate !== 0) ? Math.abs(v.playbackRate) : 1.0),
lastbw = this.lastbw / playbackRate;
var adjustedbw, i, maxAutoLevel;
if (this._autoLevelCapping === -1 && hls.levels && hls.levels.length) {
maxAutoLevel = hls.levels.length - 1;
i, maxAutoLevel;
if (this._autoLevelCapping === -1 && levels && levels.length) {
maxAutoLevel = levels.length - 1;
} else {
maxAutoLevel = this._autoLevelCapping;
}
Expand All @@ -167,7 +167,9 @@ class AbrController extends EventHandler {
return Math.min(this._nextAutoLevel,maxAutoLevel);
}

let avgbw = this.bwEstimator.getEstimate(),adjustedbw;
let playbackRate = ((v && v.playbackRate !== 0) ? Math.abs(v.playbackRate) : 1.0),
avgbw = this.bwEstimator.getEstimate()/playbackRate,
adjustedbw;
// follow algorithm captured from stagefright :
// https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
// Pick the highest bandwidth stream below or equal to estimated bandwidth.
Expand Down
2 changes: 1 addition & 1 deletion src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class StreamController extends EventHandler {
var now = performance.now();
var retryDate = this.retryDate;
// if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
if(!retryDate || (now >= retryDate) || isSeeking) {
if(!retryDate || (now >= retryDate) || (this.media && this.media.seeking)) {
logger.log(`mediaController: retryDate reached, switch back to IDLE state`);
this.state = State.IDLE;
}
Expand Down

0 comments on commit d797585

Please sign in to comment.