| Index: content/renderer/media/webrtc_audio_capturer.cc
|
| diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
|
| index ff4ecc71cb1617fb102b6cf6e5c6ceda5844d622..561965ebd803b603639085b9a0f0e2304b8a6777 100644
|
| --- a/content/renderer/media/webrtc_audio_capturer.cc
|
| +++ b/content/renderer/media/webrtc_audio_capturer.cc
|
| @@ -478,16 +478,22 @@ void WebRtcAudioCapturer::Capture(media::AudioBus* audio_source,
|
| // Process and consume the data in the processor until there is not enough
|
| // data in the processor.
|
| int16* output = NULL;
|
| + int new_volume = 0;
|
| while (audio_processor->ProcessAndConsumeData(
|
| - audio_delay, current_volume, key_pressed, &output)) {
|
| + audio_delay, current_volume, key_pressed, &new_volume, &output)) {
|
| // Feed the post-processed data to the tracks.
|
| for (TrackList::ItemList::const_iterator it = tracks.begin();
|
| it != tracks.end(); ++it) {
|
| (*it)->Capture(output, audio_delay, current_volume, key_pressed,
|
| need_audio_processing);
|
| }
|
| - // TODO(xians): Apply the new volume after AGC is working with the
|
| - // MediaStreamAudioProcessor.
|
| +
|
| + if (new_volume) {
|
| + SetVolume(new_volume);
|
| +
|
| + // Update the |current_volume| to avoid passing the old volume to AGC.
|
| + current_volume = new_volume;
|
| + }
|
| }
|
| }
|
|
|
|
|