Skip to content

Commit

Permalink
Use startPosition to determine if audio-stream-controller waiting fra…
Browse files Browse the repository at this point in the history
…gment should be cleared

Fixes #3950
  • Loading branch information
Rob Walch committed May 26, 2021
1 parent a9596f4 commit 1192057
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controller/audio-stream-controller.ts
Expand Up @@ -180,6 +180,7 @@ class AudioStreamController
const { frag, part, cache, complete } = waitingData;
if (this.initPTS[frag.cc] !== undefined) {
this.waitingData = null;
this.waitingVideoCC = -1;
this.state = State.FRAG_LOADING;
const payload = cache.flush();
const data: FragLoadedData = {
Expand All @@ -200,9 +201,10 @@ class AudioStreamController
this.clearWaitingFragment();
} else {
// Drop waiting fragment if an earlier fragment is needed
const pos = this.getLoadPosition();
const bufferInfo = BufferHelper.bufferInfo(
this.mediaBuffer,
this.media.currentTime,
pos,
this.config.maxBufferHole
);
const waitingFragmentAtPosition = fragmentWithinToleranceTest(
Expand Down

0 comments on commit 1192057

Please sign in to comment.