Fix jack client naming and improve use of pa_jack (#1847)
* Switch around Pa_Initialize and PaJack_SetClientName so that the jack client is named "Olive" on the first initialization and not on subsequent initializations when refreshing devices. * Make use of pa_jack.h dependant on availability of the header and not on the usage of the linux platform. Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "audiomanager.h"
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef PA_HAS_JACK
|
||||
#include <pa_jack.h>
|
||||
#endif
|
||||
|
||||
@@ -202,14 +202,14 @@ PaDeviceIndex AudioManager::FindDeviceByName(const QString &s, bool is_output_de
|
||||
AudioManager::AudioManager() :
|
||||
output_stream_(nullptr)
|
||||
{
|
||||
Pa_Initialize();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef PA_HAS_JACK
|
||||
// PortAudio doesn't do a strcpy, so we need a const char that's readily accessible (i.e. not
|
||||
// a QString converted to UTF-8)
|
||||
PaJack_SetClientName("Olive");
|
||||
#endif
|
||||
|
||||
Pa_Initialize();
|
||||
|
||||
// Get device from config
|
||||
PaDeviceIndex output_device = FindConfigDeviceByName(true);
|
||||
PaDeviceIndex input_device = FindConfigDeviceByName(false);
|
||||
|
||||
Reference in New Issue
Block a user