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

Unified Diff: content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc

Issue 310013002: Fix the race when the WebRtcAudioDeviceImpl goes away before capturers stop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unittests Created 6 years, 6 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/webrtc_local_audio_track_adapter.cc
diff --git a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc
index 95958a8880df42cf17942fcd8c83e4b094b90287..d94edb83d47f7bfe80011ed3f57ae9e4188ca3b0 100644
--- a/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc
+++ b/content/renderer/media/webrtc/webrtc_local_audio_track_adapter.cc
@@ -143,7 +143,16 @@ webrtc::AudioSourceInterface* WebRtcLocalAudioTrackAdapter::GetSource() const {
}
cricket::AudioRenderer* WebRtcLocalAudioTrackAdapter::GetRenderer() {
- return this;
+ // When the audio track processing is enabled, return a NULL so that capture
+ // data goes through Libjingle LocalAudioTrackHandler::LocalAudioSinkAdapter
+ // ==> WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer ==> WebRTC.
+ // When the audio track processing is disabled, WebRtcLocalAudioTrackAdapter
+ // is used to pass the channel ids to WebRtcAudioDeviceImpl, the data flow
+ // becomes WebRtcAudioDeviceImpl ==> WebRTC.
+ // TODO(xians): Only return NULL after the APM in WebRTC is deprecated.
+ // See See http://crbug/365672 for details.
+ return MediaStreamAudioProcessor::IsAudioTrackProcessingEnabled()?
+ NULL : this;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698