Index: webrtc/media/engine/webrtcvoiceengine.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
index 21094fde4d45af8baed7c5228237a5caba363e04..4fcfdb8f7e6fe8ffe87a1d4318dbf91ba0ad312e 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine.cc |
@@ -1078,6 +1078,12 @@ int WebRtcVoiceEngine::CreateVoEChannel() { |
return voe_wrapper_->base()->CreateChannel(voe_config_); |
} |
+webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() { |
+ RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
+ RTC_DCHECK(adm_); |
+ return adm_; |
+} |
+ |
class WebRtcVoiceMediaChannel::WebRtcAudioSendStream |
: public AudioSource::Sink { |
public: |
@@ -1800,9 +1806,17 @@ void WebRtcVoiceMediaChannel::SetSend(bool send) { |
return; |
} |
- // Apply channel specific options when channel is enabled for sending. |
+ // Apply channel specific options, and initialize the ADM for recording (this |
+ // may take time on some platforms, e.g. Android). |
if (send) { |
engine()->ApplyOptions(options_); |
+ |
+ // InitRecording() will return an error if the ADM is already recording. |
+ if (!engine()->adm()->Recording()) { |
Taylor Brandstetter
2016/04/01 18:41:02
Shouldn't this call "RecordingIsInitialized"?
the sun
2016/04/01 21:35:40
Actually, it looks like both must be checked. Look
|
+ if (engine()->adm()->InitRecording() != 0) { |
+ LOG(LS_WARNING) << "Failed to initialize recording"; |
+ } |
+ } |
} |
// Change the settings on each send channel. |