Commit 333b17e4 authored by henrika's avatar henrika Committed by Commit Bot

Prevents issue in webrtc::ValidateLayout for devices with more than 8 output channels

It seems like there are some audio devices with more than 8 channels (on Mac) trying to
render remote media streams. Given that there is no standards on how to upmix to more
than 8 channels we instead provide silence in these extreme cases instead of crashing
which was the case before.

Bug: 986415
Change-Id: I82d9422e4888cb07ccc1c531e3276f2685bff6cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1751191Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Henrik Andreasson <henrika@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686395}
parent 32f60f7c
......@@ -56,9 +56,13 @@ void WebRtcAudioDeviceImpl::RenderData(media::AudioBus* audio_bus,
sink->OnRenderThreadChanged();
}
#endif
if (!playing_) {
if (!playing_ || audio_bus->channels() > 8) {
// Force silence to AudioBus after stopping playout in case
// there is lingering audio data in AudioBus.
// there is lingering audio data in AudioBus or if the audio device has
// more than eight channels (which is not supported by the channel mixer
// in WebRTC).
// See http://crbug.com/986415 for details on why the extra check for
// number of channels is required.
audio_bus->Zero();
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment