New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stalling on discontinuity with audio track #2919
Conversation
// Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS | ||
const waitingFrag = this.waitingFragment; | ||
if (waitingFrag) { | ||
const waitingFragCC = waitingFrag.frag.cc; | ||
if (videoTrackCC !== waitingFragCC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're actually waiting for videoTrackCC
to increment so this is not a good check.
@@ -320,26 +297,24 @@ class AudioStreamController extends BaseStreamController { | |||
} | |||
break; | |||
case State.WAITING_INIT_PTS: | |||
const videoTrackCC = this.videoTrackCC; | |||
if (this.initPTS[videoTrackCC] === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
videoTrackCC
is set in onInitPTS
so I don't see how this check would ever be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we really want to know here is stream-controller current fragment - which fragment cc and start time is being loaded and whether that is close to or precedes our waiting fragment without any audio buffer gaps in between.
0b4c12f
to
a3c587c
Compare
…nt was set and initPTS was not found
This PR will...
Improve the handling of audio-stream-controller
waitingFrag
by:fragmentWithinToleranceTest
in audio-stream-controllerWhy is this Pull Request needed?
The audio-stream-controller got stuck on discontinuities for because the waiting was not used when it should be and it's status was not managed correctly:
videoTrackCC
is only updated onceinitPTS[waitingFragCC]
is available, which caused the waiting fragment to be cleared beforeonInitPtsFound
could fire. UsingvideoTrackCC
to see if we still needed the waiting fragment simply did not work.waitingFrag
was set tonull
in several places, requiring that fragment to be reloaded, but without clearing it's status from the fragment-tracker, so it would not reload.Are there any points in the code the reviewer needs to double check?
Resolves issues:
Resolved #2913, #2545
Related to #2832
Checklist