Bug 1037000 - Include "default communications device" in the audio input enumeration for gUM. r=padenot, a=sledru
authorRandell Jesup <rjesup@jesup.org>
Thu, 10 Jul 2014 13:15:26 -0400
changeset 209339 ee74d30a89686fafe5a5efb49fb4036f1846f98c
parent 209338 fc7ce6481ea92bf487f4bf28790ad8aa5006cf63
child 209340 ac0afa7b1b258be38c0ea6f2e641821fec484a18
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, sledru
bugs1037000
milestone32.0
Bug 1037000 - Include "default communications device" in the audio input enumeration for gUM. r=padenot, a=sledru
content/media/webrtc/MediaEngineWebRTC.cpp
--- a/content/media/webrtc/MediaEngineWebRTC.cpp
+++ b/content/media/webrtc/MediaEngineWebRTC.cpp
@@ -262,17 +262,24 @@ MediaEngineWebRTC::EnumerateAudioDevices
 
   ptrVoEHw = webrtc::VoEHardware::GetInterface(mVoiceEngine);
   if (!ptrVoEHw)  {
     return;
   }
 
   int nDevices = 0;
   ptrVoEHw->GetNumOfRecordingDevices(nDevices);
-  for (int i = 0; i < nDevices; i++) {
+  int i;
+#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+  i = 0; // Bug 1037025 - let the OS handle defaulting for now on android/b2g
+#else
+  // -1 is "default communications device" depending on OS in webrtc.org code
+  i = -1;
+#endif
+  for (; i < nDevices; i++) {
     // We use constants here because GetRecordingDeviceName takes char[128].
     char deviceName[128];
     char uniqueId[128];
     // paranoia; jingle doesn't bother with this
     deviceName[0] = '\0';
     uniqueId[0] = '\0';
 
     int error = ptrVoEHw->GetRecordingDeviceName(i, deviceName, uniqueId);