(JACK) Query audio device from settings struct again

This commit is contained in:
twinaphex 2020-05-21 04:21:00 +02:00
parent a4f143a71a
commit 4f2566ad50

View File

@ -25,6 +25,7 @@
#include <boolean.h> #include <boolean.h>
#include <rthreads/rthreads.h> #include <rthreads/rthreads.h>
#include "../../configuration.h"
#include "../../retroarch.h" #include "../../retroarch.h"
#include "../../verbosity.h" #include "../../verbosity.h"
@ -96,13 +97,13 @@ static void shutdown_cb(void *data)
#endif #endif
} }
static int parse_ports(const char *audio_device, static int parse_ports(char **dest_ports, const char **jports)
char **dest_ports, const char **jports)
{ {
int i; int i;
char *save = NULL; char *save = NULL;
int parsed = 0; int parsed = 0;
char *audio_device_cpy = strdup(audio_device); settings_t *settings = config_get_ptr();
char *audio_device_cpy = strdup(settings->arrays.audio_device);
const char *con = strtok_r(audio_device_cpy, ",", &save); const char *con = strtok_r(audio_device_cpy, ",", &save);
if (con) if (con)
@ -203,7 +204,7 @@ static void *ja_init(const char *device,
} }
} }
parsed = parse_ports(device, dest_ports, jports); parsed = parse_ports(dest_ports, jports);
if (jack_activate(jd->client) < 0) if (jack_activate(jd->client) < 0)
{ {