Skip to content
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 silence insertion to not insert extra frames when audio is offset… #143

Merged
merged 2 commits into from
Mar 2, 2017

Conversation

gesinger
Copy link
Contributor

… from video

// determine frame clock duration based on sample rate, round up to avoid overfills
frameDuration = Math.ceil(ONE_SECOND_IN_TS / (track.samplerate / 1024));
// gap is at least a frame duration
baseMediaDecodeTimeTs - audioAppendStartTs >= frameDuration) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this condition should be:

baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime) >= frameDuration

...but if that is the case then we can just remove the condition completely since it'll be calculated below and, if this were to evaluate to false, would result in a value that is audioFillFrameCount < 1 and we will exit early.

@forbesjo forbesjo self-assigned this Mar 1, 2017
@forbesjo
Copy link
Contributor

forbesjo commented Mar 1, 2017

Looks good to me

@imbcmdth imbcmdth merged commit c9805db into videojs:master Mar 2, 2017
aN0obIs pushed a commit to aN0obIs/mux.js that referenced this pull request Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants