Commit 806a9f02 authored by Max Kellermann's avatar Max Kellermann

jack: initialize JackData in jack_initDriver()

Over the lifetime of the jack AudioOutput object, we want a single valid JackData object, so we can persistently store data there (configuration etc.). Allocate JackData in jack_initDriver(). After that, we can safely remove all audioOutput->data==NULL checks (and replace them with assertions).
parent 83215bf9
......@@ -205,7 +205,7 @@ static int jack_initDriver(AudioOutput *audioOutput, ConfigParam *param)
int val;
char *cp = NULL;
audioOutput->data = NULL;
audioOutput->data = newJackData();
DEBUG("jack_initDriver (pid=%d)\n", getpid());
if ( ! param ) return 0;
......@@ -345,11 +345,7 @@ static int jack_openDevice(AudioOutput *audioOutput)
{
JackData *jd = audioOutput->data;
if ( !jd ) {
DEBUG("connect!\n");
jd = newJackData();
audioOutput->data = jd;
}
assert(jd != NULL);
if (jd->client == NULL && connect_jack(audioOutput) < 0) {
freeJackClient(jd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment