Skip to content

Commit

Permalink
Set AudioCapabilities.DEFAULT_MAX_CHANNEL_COUNT to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricxperi committed May 5, 2023
1 parent d9129c2 commit a9274b9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@UnstableApi
public final class AudioCapabilities {

private static final int DEFAULT_MAX_CHANNEL_COUNT = 8;
private static final int DEFAULT_MAX_CHANNEL_COUNT = 10;
private static final int DEFAULT_SAMPLE_RATE_HZ = 48_000;

/** The minimum audio capabilities supported by all devices. */
Expand Down Expand Up @@ -223,12 +223,7 @@ public Pair<Integer, Integer> getEncodingAndChannelConfigForPassthrough(Format f
channelCount = getMaxSupportedChannelCountForPassthrough(encoding, sampleRate);
} else {
channelCount = format.channelCount;
if (format.sampleMimeType == MimeTypes.AUDIO_DTS_X) {
if (channelCount > 10) {
// To fix wrong reporting from device. ChannelCount is reported as 8 for DTS:X P2 on some devices
return null;
}
} else if (channelCount > maxChannelCount) {
if (channelCount > maxChannelCount) {
return null;
}
}
Expand Down

0 comments on commit a9274b9

Please sign in to comment.