Index: webrtc/media/engine/webrtcvoiceengine.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
index 46119311bce328c4b47f5b139c3e776855bee855..5e7ff1a3b9429cbbdd7d8ad46dcfdfb65dcb9001 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine.cc |
@@ -1855,9 +1855,18 @@ 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() may return an error if the ADM is already recording. |
+ if (!engine()->adm()->RecordingIsInitialized() && |
+ !engine()->adm()->Recording()) { |
+ if (engine()->adm()->InitRecording() != 0) { |
+ LOG(LS_WARNING) << "Failed to initialize recording"; |
+ } |
+ } |
} |
// Change the settings on each send channel. |