Skip to content

Commit

Permalink
Merge pull request #728 from lawadr:audio-capabilities-fix
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 574829263
  • Loading branch information
copybara-github committed Oct 19, 2023
2 parents 2673b64 + 8f44916 commit 5f80a47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
* Audio:
* Fix DTS Express audio buffer underflow issue
([#650](https://github.com/androidx/media/pull/650)).
* Fix bug where the capabilities check for E-AC3-JOC throws an
`IllegalArgumentException`
([#677](https://github.com/androidx/media/issues/677)).
* Video:
* Text:
* Remove `ExoplayerCuesDecoder`. Text tracks with `sampleMimeType =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,15 @@ public static int getMaxSupportedChannelCountForPassthrough(
// TODO(internal b/234351617): Query supported channel masks directly once it's supported,
// see also b/25994457.
for (int channelCount = DEFAULT_MAX_CHANNEL_COUNT; channelCount > 0; channelCount--) {
int channelConfig = Util.getAudioTrackChannelConfig(channelCount);
if (channelConfig == AudioFormat.CHANNEL_INVALID) {
continue;
}
AudioFormat audioFormat =
new AudioFormat.Builder()
.setEncoding(encoding)
.setSampleRate(sampleRate)
.setChannelMask(Util.getAudioTrackChannelConfig(channelCount))
.setChannelMask(channelConfig)
.build();
if (AudioTrack.isDirectPlaybackSupported(audioFormat, DEFAULT_AUDIO_ATTRIBUTES)) {
return channelCount;
Expand Down

0 comments on commit 5f80a47

Please sign in to comment.