mirror of
https://github.com/samsonjs/media.git
synced 2026-04-09 11:55:46 +00:00
Use stereo for mono audio passthrough on fugu.
Also backport the Shield workaround to v1. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=144446498
This commit is contained in:
parent
270f68a95e
commit
5a16aee2c9
1 changed files with 8 additions and 1 deletions
|
|
@ -445,7 +445,7 @@ public final class AudioTrack {
|
|||
|
||||
// Workaround for overly strict channel configuration checks on nVidia Shield.
|
||||
if (Util.SDK_INT <= 23 && "foster".equals(Util.DEVICE) && "NVIDIA".equals(Util.MANUFACTURER)) {
|
||||
switch(channelCount) {
|
||||
switch (channelCount) {
|
||||
case 7:
|
||||
channelConfig = C.CHANNEL_OUT_7POINT1_SURROUND;
|
||||
break;
|
||||
|
|
@ -459,6 +459,13 @@ public final class AudioTrack {
|
|||
}
|
||||
|
||||
boolean passthrough = !MimeTypes.AUDIO_RAW.equals(mimeType);
|
||||
|
||||
// Workaround for Nexus Player not reporting support for mono passthrough.
|
||||
// (See [Internal: b/34268671].)
|
||||
if (Util.SDK_INT <= 25 && "fugu".equals(Util.DEVICE) && passthrough && channelCount == 1) {
|
||||
channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
|
||||
}
|
||||
|
||||
@C.Encoding int sourceEncoding;
|
||||
if (passthrough) {
|
||||
sourceEncoding = getEncodingForMimeType(mimeType);
|
||||
|
|
|
|||
Loading…
Reference in a new issue