Chromium Code Reviews| 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..cae7d0882762a7e034f3fce2e2231960ef502bda 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 setting the volume more than once. |
|
ajm
2014/01/23 17:30:07
maybe:
"Update the |current_volume| to avoid passi
no longer working on chromium
2014/01/24 09:10:50
Done.
|
| + current_volume = new_volume; |
| + } |
| } |
| } |