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 audio drift in DAI streams with overlapping AAC samples #3901

Merged
merged 2 commits into from May 17, 2021

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented May 14, 2021

This PR will...

  • Pass transmuxer-interface id (playlist type) into transmuxer so that when remuxing alt-audio, samples are aligned with video based on PTS.
  • Remux overlapping AAC samples so that they are appended over earlier samples segment rather than dropping them.
  • Remove redundant audio drop/backfill code in remuxer.

Why is this Pull Request needed?

This mp4-remuxer workaround was disabled in transmuxers for audio-only streams to prioritize segment timing over PTS. This had the side-effect of appending overlapping samples in alt audio-tracks. This is something that happens a lot in certain DAI live streams leading to audio drift.

Are there any points in the code the reviewer needs to double check?

To keep alt-audio in sync with the main stream, these changes pass the playlist type down to the remuxer so that overlapping audio frames are dropped again, preventing audio drift.

Rather than perform the same workaround as before that dropped samples, moving the remixed mp4 start to match the start PTS achieves virtually the same result with less code.

Checklist

  • changes have been done against master branch, and PR does not conflict

@robwalch robwalch added this to the 1.0.4 milestone May 14, 2021
@robwalch robwalch changed the title Restore audio-frame dropping workaround required by DAI streams Fix audio drift in DAI streams with overlapping AAC samples May 16, 2021
@robwalch robwalch force-pushed the bugfix/dai-overlapping-audio-frames-in-tracks branch from ef8c166 to e75f9f2 Compare May 16, 2021 16:23
@robwalch robwalch force-pushed the bugfix/dai-overlapping-audio-frames-in-tracks branch from e75f9f2 to 74ac100 Compare May 16, 2021 18:32
@robwalch robwalch merged commit aa9bac1 into master May 17, 2021
@robwalch robwalch deleted the bugfix/dai-overlapping-audio-frames-in-tracks branch May 17, 2021 16:22
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.

None yet

1 participant