diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:15 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-31 00:44:34 -0700 |
commit | 25b5471f415db926e8b4ebe1a02e209d70757191 (patch) | |
tree | ad9670f8bf5c9b7cb5dbaf0a1ae353daf7c4d656 | |
parent | 8c419bb006e376cd0b78453a988976d96027a9f4 (diff) | |
download | mpd-25b5471f415db926e8b4ebe1a02e209d70757191.tar.gz mpd-25b5471f415db926e8b4ebe1a02e209d70757191.tar.xz mpd-25b5471f415db926e8b4ebe1a02e209d70757191.zip |
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).
Diffstat (limited to '')
-rw-r--r-- | src/audioOutputs/audioOutput_jack.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/audioOutputs/audioOutput_jack.c b/src/audioOutputs/audioOutput_jack.c index 47997df01..9fc52055f 100644 --- a/src/audioOutputs/audioOutput_jack.c +++ b/src/audioOutputs/audioOutput_jack.c @@ -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); |