| Index: media/audio/mac/audio_manager_mac.cc
|
| diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
| index 436d4ee77bcb3e6fb2413de73e3b68b053a5357f..cb2ac1f1f2f7b8fce551096508bcafee56560f7c 100644
|
| --- a/media/audio/mac/audio_manager_mac.cc
|
| +++ b/media/audio/mac/audio_manager_mac.cc
|
| @@ -447,8 +447,10 @@ bool AudioManagerMac::GetDeviceChannels(AudioDeviceID device,
|
| // only return up to 8 channels in any layout. To allow WebAudio to work with
|
| // > 8 channel devices, we must use the total channel count instead of the
|
| // channel count of the preferred layout.
|
| - if (GetDeviceTotalChannelCount(device, scope, channels) &&
|
| - *channels > kMaxConcurrentChannels) {
|
| + int total_channel_count = 0;
|
| + if (GetDeviceTotalChannelCount(device, scope, &total_channel_count) &&
|
| + total_channel_count > kMaxConcurrentChannels) {
|
| + *channels = total_channel_count;
|
| return true;
|
| }
|
|
|
| @@ -510,6 +512,12 @@ bool AudioManagerMac::GetDeviceChannels(AudioDeviceID device,
|
| }
|
| }
|
|
|
| + // If we still don't have a channel count, fall back to total channel count.
|
| + if (*channels == 0) {
|
| + DLOG(WARNING) << "Unable to use channel layout for channel count.";
|
| + *channels = total_channel_count;
|
| + }
|
| +
|
| DVLOG(1) << (scope == kAudioDevicePropertyScopeInput ? "Input" : "Output")
|
| << " channels: " << *channels;
|
| return true;
|
|
|