Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: content/renderer/media/webrtc_local_audio_track.cc

Issue 24742007: When an audio track is disabled, still pass the data to webrtc for audio processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_local_audio_track.cc
diff --git a/content/renderer/media/webrtc_local_audio_track.cc b/content/renderer/media/webrtc_local_audio_track.cc
index 37846335e8531270c5c6c66658c400137b82bcf4..0cac639eb7dc96ad10d8717dfc2a47af61b33a71 100644
--- a/content/renderer/media/webrtc_local_audio_track.cc
+++ b/content/renderer/media/webrtc_local_audio_track.cc
@@ -154,14 +154,10 @@ void WebRtcLocalAudioTrack::Capture(media::AudioBus* audio_source,
int number_of_frames = 0;
SinkList sinks;
scoped_refptr<ConfiguredBuffer> current_buffer;
+ bool disabled = false;
{
base::AutoLock auto_lock(lock_);
- // When the track is disabled, we simply return here.
- // TODO(xians): Figure out if we should feed zero to sinks instead, in
- // order to inject VAD data in such case.
- if (!enabled())
- return;
-
+ disabled = !enabled();
capturer = capturer_;
voe_channels = voe_channels_;
current_buffer = buffer_;
@@ -177,7 +173,7 @@ void WebRtcLocalAudioTrack::Capture(media::AudioBus* audio_source,
// well as there is no correct delay value.
bool need_audio_processing = need_audio_processing_ ?
need_audio_processing_ : (audio_delay_milliseconds != 0);
- int current_volume = volume;
+ int current_volume = disabled ? 0 : volume;
no longer working on chromium 2013/09/27 20:22:52 Note that you are fooling the AGC, please test thi
ajm 2013/09/27 22:54:40 This doesn't look good. You shouldn't be messing a
while (current_buffer->Consume()) {
// Feed the data to the sinks.
for (SinkList::const_iterator it = sinks.begin(); it != sinks.end(); ++it) {
@@ -190,7 +186,7 @@ void WebRtcLocalAudioTrack::Capture(media::AudioBus* audio_source,
current_volume,
need_audio_processing,
key_pressed);
- if (new_volume != 0 && capturer.get()) {
+ if (!disabled && new_volume != 0 && capturer.get()) {
// Feed the new volume to WebRtc while changing the volume on the
// browser.
capturer->SetVolume(new_volume);

Powered by Google App Engine
This is Rietveld 408576698