Skip to content

Commit

Permalink
Merge pull request #3951 from video-dev/bugfix/audio-stream-start-pos…
Browse files Browse the repository at this point in the history
…ition

Fix incorrect audio track segments loaded before video segment with > 0 startPosition
  • Loading branch information
robwalch committed May 27, 2021
2 parents 6b7a82e + 1192057 commit 4b4f4a1
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 4b4f4a1

Please sign in to comment.