Skip to content

Commit aecc8dd

Browse files
committed
Use getMaxSupportedChannelCountForPassthrough to assign channel Count
1 parent f7ab452 commit aecc8dd

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/AudioCapabilities.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public final class AudioCapabilities {
7272
new ImmutableMap.Builder<Integer, Integer>()
7373
.put(C.ENCODING_AC3, 6)
7474
.put(C.ENCODING_AC4, 6)
75-
.put(C.ENCODING_DTS, 6)
75+
.put(C.ENCODING_DTS, 10)
7676
.put(C.ENCODING_E_AC3_JOC, 6)
7777
.put(C.ENCODING_E_AC3, 8)
7878
.put(C.ENCODING_DTS_HD, 8)
@@ -211,7 +211,8 @@ public Pair<Integer, Integer> getEncodingAndChannelConfigForPassthrough(Format f
211211
return null;
212212
}
213213
int channelCount;
214-
if (format.channelCount == Format.NO_VALUE || encoding == C.ENCODING_E_AC3_JOC) {
214+
if (format.channelCount == Format.NO_VALUE || encoding == C.ENCODING_E_AC3_JOC
215+
|| encoding == C.ENCODING_DTS) {
215216
// In HLS chunkless preparation, the format channel count and sample rate may be unset. See
216217
// https://github.com/google/ExoPlayer/issues/10204 and b/222127949 for more details.
217218
// For E-AC3 JOC, the format is object based so the format channel count is arbitrary.
@@ -220,13 +221,7 @@ public Pair<Integer, Integer> getEncodingAndChannelConfigForPassthrough(Format f
220221
channelCount = getMaxSupportedChannelCountForPassthrough(encoding, sampleRate);
221222
} else {
222223
channelCount = format.channelCount;
223-
if (format.sampleMimeType == MimeTypes.AUDIO_DTS_X) {
224-
if (channelCount > 10) {
225-
// To fix wrong reporting from device. ChannelCount is reported as 8 for DTS:X P2
226-
// on some devices.
227-
return null;
228-
}
229-
} else if (channelCount > maxChannelCount) {
224+
if (channelCount > maxChannelCount) {
230225
return null;
231226
}
232227
}

0 commit comments

Comments
 (0)