Bug 1312413 - `mDefaultDevice` should be an index in `mDeviceIndexes`. r=jesup, a=gchang
authorPaul Adenot <paul@paul.cx>
Mon, 24 Oct 2016 17:26:07 +0200
changeset 358895 f68cadfae2124b54902ea4fdaacd263da441a816
parent 358894 83e1d3c7f75096287834ddea0f4d478ab3032604
child 358896 c8e0d652196fc582a73830d6db7dfa9eb027261e
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, gchang
bugs1312413
milestone51.0
Bug 1312413 - `mDefaultDevice` should be an index in `mDeviceIndexes`. r=jesup, a=gchang MozReview-Commit-ID: 8UywuqRAegy
dom/media/webrtc/MediaEngineWebRTC.cpp
--- a/dom/media/webrtc/MediaEngineWebRTC.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTC.cpp
@@ -95,17 +95,17 @@ void AudioInputCubeb::UpdateDeviceList()
       } else {
         // new device, add to the array
         mDeviceIndexes->AppendElement(i);
         mDeviceNames->AppendElement(devices->device[i]->device_id);
       }
       if (devices->device[i]->preferred & CUBEB_DEVICE_PREF_VOICE) {
         // There can be only one... we hope
         NS_ASSERTION(mDefaultDevice == -1, "multiple default cubeb input devices!");
-        mDefaultDevice = i;
+        mDefaultDevice = j;
       }
     }
   }
   LOG(("Cubeb default input device %d", mDefaultDevice));
   StaticMutexAutoLock lock(sMutex);
   // swap state
   if (mDevices) {
     cubeb_device_collection_destroy(mDevices);