Allocate before activation.

This commit is contained in:
Themaister 2011-08-14 16:24:42 +02:00
parent 4395f124ca
commit 343852af26
1 changed files with 3 additions and 4 deletions

View File

@ -130,6 +130,9 @@ static void* __jack_init(const char* device, unsigned rate, unsigned latency)
if ( jd == NULL ) if ( jd == NULL )
return NULL; return NULL;
pthread_cond_init(&jd->cond, NULL);
pthread_mutex_init(&jd->cond_lock, NULL);
const char **jports = NULL; const char **jports = NULL;
jd->client = jack_client_open("SSNES", JackNullOption, NULL); jd->client = jack_client_open("SSNES", JackNullOption, NULL);
@ -148,7 +151,6 @@ static void* __jack_init(const char* device, unsigned rate, unsigned latency)
SSNES_ERR("Failed to register ports.\n"); SSNES_ERR("Failed to register ports.\n");
goto error; goto error;
} }
char *dest_ports[2]; char *dest_ports[2];
jports = jack_get_ports(jd->client, NULL, NULL, JackPortIsPhysical | JackPortIsInput); jports = jack_get_ports(jd->client, NULL, NULL, JackPortIsPhysical | JackPortIsInput);
@ -191,9 +193,6 @@ static void* __jack_init(const char* device, unsigned rate, unsigned latency)
} }
} }
pthread_cond_init(&jd->cond, NULL);
pthread_mutex_init(&jd->cond_lock, NULL);
jack_free(jports); jack_free(jports);
return jd; return jd;