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 fmp4 segmented audio group switching #3748

Merged
merged 1 commit into from Apr 9, 2021

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Apr 8, 2021

This PR will...

  • Reset transmuxer on audio-tracks-updated to handle audio group track switching
  • Added groupId to AudioTrackSwitchingData and SubtitleTrackSwitchData (just added name recently and in light of this issue, groupId is also something you'd want to know about an upcoming track change)

Why is this Pull Request needed?

The transmuxer doesn't see audio groups so tracks in different groups with the same index appear as contiguous segments. Resetting the transmuxer on audio track update deals with this type of discontinuity resetting where audio is appended when the active group is changed.

const trackSwitch = !(lastFrag && chunkMeta.level === lastFrag.level);
const snDiff = lastFrag ? chunkMeta.sn - (lastFrag.sn as number) : -1;
const partDiff = this.part ? chunkMeta.part - this.part.index : 1;
const contiguous =
!trackSwitch && (snDiff === 1 || (snDiff === 0 && partDiff === 1));

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

I considered adding groupId or original track id indexes (across groups) to the transmux pipeline but that would involve adding them to Fragment objects, ChunkMeta, multiple playlist/track types, as well multiple event types. This change has a much smaller footprint, making it a safer patch.

Resolves issues:

Resolves #3741

Checklist

  • changes have been done against master branch, and PR does not conflict
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.0.1 milestone Apr 8, 2021
@robwalch robwalch added this to Top priorities in Release Planning and Backlog via automation Apr 8, 2021
@robwalch robwalch force-pushed the bugfix/reset-transmuxer-on-audio-tracks-updated branch from f4f52a4 to 884456d Compare April 8, 2021 23:36
@robwalch robwalch force-pushed the bugfix/reset-transmuxer-on-audio-tracks-updated branch from 884456d to be53bdc Compare April 8, 2021 23:39
@robwalch robwalch merged commit 5c628de into master Apr 9, 2021
@robwalch robwalch deleted the bugfix/reset-transmuxer-on-audio-tracks-updated branch April 9, 2021 18:08
@robwalch robwalch linked an issue Apr 14, 2021 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Release Planning and Backlog
  
Top priorities
Development

Successfully merging this pull request may close these issues.

Audio buffer was stalled when ABR bitrate was changed twice Audio buffer was stalled at first segment
1 participant