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

This commit is contained in:
Randell Jesup 2016-08-04 21:24:05 -04:00
parent 94b1da6b55
commit fd8a8c3c74
2 changed files with 6 additions and 7 deletions

View File

@ -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,11 +348,12 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
return;
}
if (!mAudioEngineInit) {
if (ptrVoEBase->Init() < 0) {
return;
}
mAudioEngineInit = true;
// 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;
}
if (!mAudioInput) {

View File

@ -599,7 +599,6 @@ private:
webrtc::VoiceEngine* mVoiceEngine;
webrtc::Config mConfig;
RefPtr<mozilla::AudioInput> mAudioInput;
bool mAudioEngineInit;
bool mFullDuplex;
bool mExtendedFilter;
bool mDelayAgnostic;