Skip to content

Fix AudioCapabilities regression#728

Merged
copybara-service[bot] merged 2 commits intoandroidx:mainfrom
lawadr:audio-capabilities-fix
Oct 19, 2023
Merged

Fix AudioCapabilities regression#728
copybara-service[bot] merged 2 commits intoandroidx:mainfrom
lawadr:audio-capabilities-fix

Conversation

@lawadr
Copy link
Copy Markdown
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 force-pushed the audio-capabilities-fix branch from 8117b82 to 8f44916 Compare October 19, 2023 08:45
@tonihei tonihei assigned tonihei and unassigned marcbaechinger Oct 19, 2023
@copybara-service copybara-service bot merged commit 5f80a47 into androidx:main Oct 19, 2023
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.

3 participants