From bc41087ea940851576d936209097aaaf98fdcfc3 Mon Sep 17 00:00:00 2001 From: amerhifi Date: Tue, 5 Nov 2019 12:50:59 -0800 Subject: [PATCH] removing lock from WASAPI initialization --- libraries/audio-client/src/AudioClient.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 61e0a37161..612493db2e 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -324,12 +324,10 @@ AudioClient::AudioClient() { connect(&_receivedAudioStream, &InboundAudioStream::mismatchedAudioCodec, this, &AudioClient::handleMismatchAudioFormat); - { - QReadLocker readLock(&_hmdNameLock); - // initialize wasapi; if getAvailableDevices is called from the CheckDevicesThread before this, it will crash - getAvailableDevices(QAudio::AudioInput, _hmdInputName); - getAvailableDevices(QAudio::AudioOutput, _hmdOutputName); - } + // initialize wasapi; if getAvailableDevices is called from the CheckDevicesThread before this, it will crash + getAvailableDevices(QAudio::AudioInput, QString()); + getAvailableDevices(QAudio::AudioOutput, QString()); + // start a thread to detect any device changes _checkDevicesTimer = new QTimer(this); const unsigned long DEVICE_CHECK_INTERVAL_MSECS = 2 * 1000;