mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Expand passthrough channel count workaround to all devices
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=206893078
This commit is contained in:
parent
f08ad55892
commit
429bf4d099
1 changed files with 6 additions and 3 deletions
|
|
@ -1129,11 +1129,14 @@ public final class DefaultAudioSink implements AudioSink {
|
|||
}
|
||||
|
||||
private static int getChannelConfig(int channelCount, boolean isInputPcm) {
|
||||
// Workaround for overly strict channel configuration checks on nVidia Shield.
|
||||
if (Util.SDK_INT <= 23 && "foster".equals(Util.DEVICE) && "NVIDIA".equals(Util.MANUFACTURER)) {
|
||||
if (Util.SDK_INT <= 28 && !isInputPcm) {
|
||||
// In passthrough mode the channel count used to configure the audio track doesn't affect how
|
||||
// the stream is handled, except that some devices do overly-strict channel configuration
|
||||
// checks. Therefore we override the channel count so that a known-working channel
|
||||
// configuration is chosen in all cases. See [Internal: b/29116190].
|
||||
if (channelCount == 7) {
|
||||
channelCount = 8;
|
||||
} else if (channelCount == 3 || channelCount == 5) {
|
||||
} else if (channelCount == 3 || channelCount == 4 || channelCount == 5) {
|
||||
channelCount = 6;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue