From a69c34ffbb49c5f2a79a5f124e8bf9b2b41df8ff Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Wed, 24 Apr 2019 09:41:52 -0500 Subject: [PATCH] Small refactor to audio device manager initialise (to prevent compile breakage on Mac) --- src/Qt/AudioPlaybackThread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Qt/AudioPlaybackThread.cpp b/src/Qt/AudioPlaybackThread.cpp index 28db8df6..d31f719e 100644 --- a/src/Qt/AudioPlaybackThread.cpp +++ b/src/Qt/AudioPlaybackThread.cpp @@ -41,13 +41,16 @@ namespace openshot // Create the actual instance of device manager only once m_pInstance = new AudioDeviceManagerSingleton; + // Get preferred audio device name (if any) + string preferred_audio_device = Settings::Instance()->PLAYBACK_AUDIO_DEVICE_NAME; + // Initialize audio device only 1 time String error = m_pInstance->audioDeviceManager.initialise ( 0, /* number of input channels */ 2, /* number of output channels */ 0, /* no XML settings.. */ true, /* select default device on failure */ - Settings::Instance()->PLAYBACK_AUDIO_DEVICE_NAME /* preferredDefaultDeviceName */); + preferred_audio_device /* preferredDefaultDeviceName */); // Persist any errors detected if (error.isNotEmpty()) {