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 AudioCapabilities regression #728

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

lawadr
Copy link
Contributor

@lawadr lawadr commented Oct 15, 2023

Since DEFAULT_MAX_CHANNEL_COUNT was increased from 8 to 10, getMaxSupportedChannelCountForPassthrough always throws if its loop enters its second iteration (channelCount of 9). This is due to Util.getAudioTrackChannelConfig returning CHANNEL_INVALID when passed a channelCount of 9, and setting CHANNEL_INVALID as the AudioFormat's channel mask throws an exception.

This change skips each iteration where CHANNEL_INVALID is returned.

Fixes issue #677

lawadr and others added 2 commits October 19, 2023 09:17
Since DEFAULT_MAX_CHANNEL_COUNT was increased from 8 to 10,
getMaxSupportedChannelCountForPassthrough always throws if its loop
enters its second iteration (channelCount of 9). This is due to
Util.getAudioTrackChannelConfig returning CHANNEL_INVALID when passed a
channelCount of 9, and setting CHANNEL_INVALID as the AudioFormat's
channel mask throws an exception.

This change skips each iteration where CHANNEL_INVALID is returned.
@tonihei tonihei assigned tonihei and unassigned marcbaechinger Oct 19, 2023
@copybara-service copybara-service bot merged commit 5f80a47 into androidx:main Oct 19, 2023
1 check passed
rohitjoins pushed a commit that referenced this pull request Oct 23, 2023
PiperOrigin-RevId: 574829263
(cherry picked from commit 5f80a47)
rohitjoins pushed a commit that referenced this pull request Oct 24, 2023
PiperOrigin-RevId: 574829263
(cherry picked from commit 5f80a47)
@androidx androidx locked and limited conversation to collaborators Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants