Update AudioClient.cpp

Fix double locking attempt if waitForFinished causes prepareLocalAudioInjectors to be called on this thread.

Co-Authored-By: Heather Anderson <1115056+odysseus654@users.noreply.github.com>
This commit is contained in:
Kalila L 2020-09-14 02:58:36 -04:00
parent e6f3ba4458
commit 932a3b9e91

View file

@ -2072,7 +2072,6 @@ bool AudioClient::switchOutputToAudioDevice(const HifiAudioDeviceInfo outputDevi
// NOTE: device start() uses the Qt internal device list
Lock lock(_deviceMutex);
Lock localAudioLock(_localAudioMutex);
_localSamplesAvailable.exchange(0, std::memory_order_release);
//wait on local injectors prep to finish running
@ -2080,6 +2079,8 @@ bool AudioClient::switchOutputToAudioDevice(const HifiAudioDeviceInfo outputDevi
_localPrepInjectorFuture.waitForFinished();
}
Lock localAudioLock(_localAudioMutex);
// cleanup any previously initialized device
if (_audioOutput) {
_audioOutputIODevice.close();