Skip to content

Commit

Permalink
fix video-dev#2079: drop fragCurrent on buffer flush
Browse files Browse the repository at this point in the history
  • Loading branch information
mad-gooze committed Jan 25, 2019
1 parent 2d94876 commit aa10be8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/controller/audio-stream-controller.js
Expand Up @@ -836,6 +836,23 @@ class AudioStreamController extends BaseStreamController {
this.state = State.IDLE;
// reset reference to frag
this.fragPrevious = null;

const { fragCurrent } = this;
if (fragCurrent) {
const { loader } = fragCurrent;
if (loader) {
// abort current frag to reload it and re-trigger onFragLoaded
loader.abort();
}

const state = this.fragmentTracker.getState(fragCurrent);
if (state === FragmentState.APPENDING || state === FragmentState.PARTIAL) {
// if frag is not loaded, remove it from fragment tracker to prevent loop
this.fragmentTracker.removeFragment(fragCurrent);
this.fragCurrent = null;
}
}

this.tick();
}
}
Expand Down

0 comments on commit aa10be8

Please sign in to comment.