Skip to content

Validate the base audio encoder configuration first - #996

Open
JinDX wants to merge 1 commit into
w3c:mainfrom
JinDX:fix-audio-encoder-base-validation
Open

JinDX wants to merge 1 commit into
w3c:mainfrom
JinDX:fix-audio-encoder-base-validation

Conversation

@JinDX

@JinDX JinDX commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Check sampleRate and numberOfChannels before returning the codec-specific validation result.

Found while reviewing the Chinese, Japanese, and Korean translations.


Preview | Diff

@Djuffin

Djuffin commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

why is it important?

@JinDX

JinDX commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@Djuffin Thanks for asking. For example, { codec: "opus", sampleRate: 0, numberOfChannels: 2, opus: {} } passes the Opus extension validation. The current spec algorithm immediately returns that true result, so it never checks the zero sampleRate.

Moving the zero checks first prevents valid codec-specific options from bypassing the base configuration checks.

This branch has not been deployed

No deployments
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