diff options
author | Max Kellermann <max@duempel.org> | 2009-01-29 23:15:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-29 23:15:27 +0100 |
commit | 5a2949552b63abc81b4a48c9b8c07e88b8c0d11e (patch) | |
tree | c58901a2cb784bf4e6400bb176c8c0c2a0830d42 | |
parent | eccc7c21bda4c4d5009a15feb8e686591d99d491 (diff) | |
download | mpd-5a2949552b63abc81b4a48c9b8c07e88b8c0d11e.tar.gz mpd-5a2949552b63abc81b4a48c9b8c07e88b8c0d11e.tar.xz mpd-5a2949552b63abc81b4a48c9b8c07e88b8c0d11e.zip |
jack: make mpd_jack_connect() return bool
Return true/false instead of 1/-1.
-rw-r--r-- | src/output/jack_plugin.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c index 426b693ac..2cda53784 100644 --- a/src/output/jack_plugin.c +++ b/src/output/jack_plugin.c @@ -55,7 +55,7 @@ struct jack_data { jack_client_t *client; jack_ringbuffer_t *ringbuffer[2]; int bps; - int shutdown; + bool shutdown; }; static const char * @@ -147,7 +147,7 @@ static void mpd_jack_shutdown(void *arg) { struct jack_data *jd = (struct jack_data *) arg; - jd->shutdown = 1; + jd->shutdown = true; } static void @@ -212,7 +212,7 @@ mpd_jack_test_default_device(void) return true; } -static int +static bool mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) { jd->audio_format = audio_format; @@ -225,7 +225,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) if ((jd->client = jack_client_new(mpd_jack_name(jd))) == NULL) { g_warning("jack server not running?"); - return -1; + return false; } jack_set_process_callback(jd->client, mpd_jack_process, jd); @@ -239,13 +239,13 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) if (jd->ports[i] == NULL) { g_warning("Cannot register %s output port.", port_names[i]); - return -1; + return false; } } if ( jack_activate(jd->client) ) { g_warning("cannot activate client"); - return -1; + return false; } if (jd->output_ports[1] == NULL) { @@ -257,7 +257,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) JackPortIsPhysical | JackPortIsInput); if (jports == NULL) { g_warning("no ports found"); - return -1; + return false; } jd->output_ports[0] = g_strdup(jports[0]); @@ -276,11 +276,11 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) if (ret != 0) { g_warning("%s is not a valid Jack Client / Port", jd->output_ports[i]); - return -1; + return false; } } - return 1; + return true; } static bool @@ -290,7 +290,7 @@ mpd_jack_open(void *data, struct audio_format *audio_format) assert(jd != NULL); - if (jd->client == NULL && mpd_jack_connect(jd, audio_format) < 0) { + if (jd->client == NULL && !mpd_jack_connect(jd, audio_format)) { mpd_jack_client_free(jd); return false; } |