mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-10 13:02:27 +00:00
Fixes a bug where jack audio device setting would be clamped down to only one channel. Caused by a misuse of strtok.
This commit is contained in:
parent
6f05fe0ff5
commit
4ee1e2bba6
@ -103,10 +103,12 @@ static void shutdown_cb(void *data)
|
||||
static int parse_ports(char **dest_ports, const char **jports)
|
||||
{
|
||||
int i;
|
||||
char *save = NULL;
|
||||
char *save = NULL, *audio_device_cpy;
|
||||
int parsed = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *con = strtok_r(settings->audio.device, ",", &save);
|
||||
|
||||
audio_device_cpy = strdup(settings->audio.device);
|
||||
const char *con = strtok_r(audio_device_cpy, ",", &save);
|
||||
|
||||
if (con)
|
||||
dest_ports[parsed++] = strdup(con);
|
||||
@ -117,6 +119,7 @@ static int parse_ports(char **dest_ports, const char **jports)
|
||||
for (i = parsed; i < 2; i++)
|
||||
dest_ports[i] = strdup(jports[i]);
|
||||
|
||||
free(audio_device_cpy);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user