Skip to content

Handle channel count parsing for AC-4 with discrete objects #2526

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ybai001
Copy link
Contributor

@ybai001 ybai001 commented Jun 11, 2025

Some AC-4 stream consists of sub stream with discrete objects. Due to limitations in the current AC-4 specification (ETSI TS 103 190-2 V1.2.1 (2018-02)), discrete object number information is not explicitly stated in the ISO Base Media File Format (Annex E). To prevent exception triggering, "Maximum number of tracks if audio presentation includes object audio" in table 77 of ETSI TS 103 190-2 V1.2.1 (2018-02) is used as the channel count.

This pull request provides the corresponding implementation in AC4 parser.

// prevent exceptions, "Maximum number of tracks if audio presentation includes object
// audio" in table 77 of ETSI TS 103 190-2 V1.2.1 (2018-02) is used as the channel count.
switch (ac4Presentation.level) {
case 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this case be part of the default handling in the switch case?

case 3:
channelCount = 10;
break;
case 4:
Copy link
Contributor

Choose a reason for hiding this comment

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

Table 77 in spec ETSI TS 103 190-2 V1.2.1 (2018-02) states the value 4-6 is reserved, where do we get the value 12 for this?

case 4:
channelCount = 12;
break;
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we throw an error from here instead of defaulting to channel count 2?

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.

2 participants