| Index: media/audio/cras/cras_input.cc
|
| diff --git a/media/audio/cras/cras_input.cc b/media/audio/cras/cras_input.cc
|
| index 0c24be94cafc50e7a0856182166973be986e178e..af63eabbe30536e3977b5a90afb761ffb983f547 100644
|
| --- a/media/audio/cras/cras_input.cc
|
| +++ b/media/audio/cras/cras_input.cc
|
| @@ -27,8 +27,12 @@ CrasInputStream::CrasInputStream(const AudioParameters& params,
|
| stream_id_(0),
|
| stream_direction_(CRAS_STREAM_INPUT),
|
| pin_device_(NO_DEVICE),
|
| - is_loopback_(device_id ==
|
| - AudioDeviceDescription::kLoopbackInputDeviceId) {
|
| + is_loopback_(
|
| + device_id == AudioDeviceDescription::kLoopbackInputDeviceId ||
|
| + device_id == AudioDeviceDescription::kLoopbackWithMuteDeviceId),
|
| + mute_system_audio_(device_id ==
|
| + AudioDeviceDescription::kLoopbackWithMuteDeviceId),
|
| + mute_done_(false) {
|
| DCHECK(audio_manager_);
|
| audio_bus_ = AudioBus::Create(params_);
|
| }
|
| @@ -93,6 +97,12 @@ bool CrasInputStream::Open() {
|
| client_ = NULL;
|
| return false;
|
| }
|
| +
|
| + if (mute_system_audio_ && !cras_client_get_system_muted(client_)) {
|
| + cras_client_set_system_mute(client_, 1);
|
| + mute_done_ = true;
|
| + }
|
| +
|
| pin_device_ = cras_client_get_first_dev_type_idx(client_,
|
| CRAS_NODE_TYPE_POST_MIX_PRE_DSP, CRAS_STREAM_INPUT);
|
| if (pin_device_ < 0) {
|
| @@ -231,6 +241,11 @@ void CrasInputStream::Stop() {
|
| if (!callback_ || !started_)
|
| return;
|
|
|
| + if (mute_system_audio_ && mute_done_) {
|
| + cras_client_set_system_mute(client_, 0);
|
| + mute_done_ = false;
|
| + }
|
| +
|
| StopAgc();
|
|
|
| // Removing the stream from the client stops audio.
|
|
|