Commit bc377d9b authored by Guohui Deng's avatar Guohui Deng Committed by Commit Bot

Initialize channel_layout in CastAudioOutputStream

CastAudioOutputStream::CmaWrapper failed to set the correct value
on |channel_layout| in |audio_config|. The default value is considered
to be invalid and causes error when sent through Mojo pipe.

Bug: internal b/129642940
Test: None
Change-Id: Ie449ee966c4d79717a4951e18b1953f62a109929
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1562089Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Guohui Deng <guohuideng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649669}
parent 00a3fe85
...@@ -207,10 +207,13 @@ void CastAudioOutputStream::CmaWrapper::Initialize( ...@@ -207,10 +207,13 @@ void CastAudioOutputStream::CmaWrapper::Initialize(
AudioConfig audio_config; AudioConfig audio_config;
audio_config.codec = kCodecPCM; audio_config.codec = kCodecPCM;
audio_config.channel_layout =
ChannelLayoutFromChannelNumber(audio_params_.channels());
audio_config.sample_format = kSampleFormatS16; audio_config.sample_format = kSampleFormatS16;
audio_config.bytes_per_channel = 2; audio_config.bytes_per_channel = 2;
audio_config.channel_number = audio_params_.channels(); audio_config.channel_number = audio_params_.channels();
audio_config.samples_per_second = audio_params_.sample_rate(); audio_config.samples_per_second = audio_params_.sample_rate();
DCHECK(IsValidConfig(audio_config));
if (!audio_decoder_->SetConfig(audio_config)) { if (!audio_decoder_->SetConfig(audio_config)) {
encountered_error_ = true; encountered_error_ = true;
return; 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