mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:57:18 +02:00
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:
parent
e6f3ba4458
commit
932a3b9e91
1 changed files with 2 additions and 1 deletions
|
@ -2072,7 +2072,6 @@ bool AudioClient::switchOutputToAudioDevice(const HifiAudioDeviceInfo outputDevi
|
||||||
// NOTE: device start() uses the Qt internal device list
|
// NOTE: device start() uses the Qt internal device list
|
||||||
Lock lock(_deviceMutex);
|
Lock lock(_deviceMutex);
|
||||||
|
|
||||||
Lock localAudioLock(_localAudioMutex);
|
|
||||||
_localSamplesAvailable.exchange(0, std::memory_order_release);
|
_localSamplesAvailable.exchange(0, std::memory_order_release);
|
||||||
|
|
||||||
//wait on local injectors prep to finish running
|
//wait on local injectors prep to finish running
|
||||||
|
@ -2080,6 +2079,8 @@ bool AudioClient::switchOutputToAudioDevice(const HifiAudioDeviceInfo outputDevi
|
||||||
_localPrepInjectorFuture.waitForFinished();
|
_localPrepInjectorFuture.waitForFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lock localAudioLock(_localAudioMutex);
|
||||||
|
|
||||||
// cleanup any previously initialized device
|
// cleanup any previously initialized device
|
||||||
if (_audioOutput) {
|
if (_audioOutput) {
|
||||||
_audioOutputIODevice.close();
|
_audioOutputIODevice.close();
|
||||||
|
|
Loading…
Reference in a new issue