Commit fd8a8c3c authored by Randell Jesup's avatar Randell Jesup
Browse files

Bug 1290075: Always Init() the VoiceEngine when enumerating audio inputs r=jib

parent 94b1da6b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ MediaEngineWebRTC::MediaEngineWebRTC(MediaEnginePrefs &aPrefs)
  : mMutex("mozilla::MediaEngineWebRTC"),
    mVoiceEngine(nullptr),
    mAudioInput(nullptr),
    mAudioEngineInit(false),
    mFullDuplex(aPrefs.mFullDuplex),
    mExtendedFilter(aPrefs.mExtendedFilter),
    mDelayAgnostic(aPrefs.mDelayAgnostic)
@@ -349,12 +348,13 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
    return;
  }

  if (!mAudioEngineInit) {
  // Always re-init the voice engine, since if we close the last use we
  // DeInitEngine() and Terminate(), which shuts down Process() - but means
  // we have to Init() again before using it.  Init() when already inited is
  // just a no-op, so call always.
  if (ptrVoEBase->Init() < 0) {
    return;
  }
    mAudioEngineInit = true;
  }

  if (!mAudioInput) {
    if (SupportsDuplex()) {
+0 −1
Original line number Diff line number Diff line
@@ -599,7 +599,6 @@ private:
  webrtc::VoiceEngine* mVoiceEngine;
  webrtc::Config mConfig;
  RefPtr<mozilla::AudioInput> mAudioInput;
  bool mAudioEngineInit;
  bool mFullDuplex;
  bool mExtendedFilter;
  bool mDelayAgnostic;