| Index: media/audio/cras/cras_input.cc
|
| diff --git a/media/audio/cras/cras_input.cc b/media/audio/cras/cras_input.cc
|
| index 9f2e46944fa248a79cf4b9bcb55fa88d1b9e3c23..e8b08eed9d665eca25b05bde15e3ed7ef960c765 100644
|
| --- a/media/audio/cras/cras_input.cc
|
| +++ b/media/audio/cras/cras_input.cc
|
| @@ -28,8 +28,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_);
|
| if (!IsDefault(device_id)) {
|
| @@ -99,6 +103,7 @@ bool CrasInputStream::Open() {
|
| client_ = NULL;
|
| return false;
|
| }
|
| +
|
| pin_device_ = cras_client_get_first_dev_type_idx(client_,
|
| CRAS_NODE_TYPE_POST_MIX_PRE_DSP, CRAS_STREAM_INPUT);
|
| if (pin_device_ < 0) {
|
| @@ -223,6 +228,12 @@ void CrasInputStream::Start(AudioInputCallback* callback) {
|
| callback_ = NULL;
|
| }
|
|
|
| + // Mute system audio if requested.
|
| + if (mute_system_audio_ && !cras_client_get_system_muted(client_)) {
|
| + cras_client_set_system_mute(client_, 1);
|
| + mute_done_ = true;
|
| + }
|
| +
|
| // Done with config params.
|
| cras_audio_format_destroy(audio_format);
|
| cras_client_stream_params_destroy(stream_params);
|
| @@ -237,6 +248,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.
|
|
|