diff options
author | Max Kellermann <max@duempel.org> | 2009-01-29 23:12:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-29 23:12:10 +0100 |
commit | 5bcf415ad050e404ab5c74b8398e8e1558bcdb17 (patch) | |
tree | e2e6b06b46085bf604f7cfbc9481abbf25c4ef68 /src/output/jack_plugin.c | |
parent | 67cf2ee6e4ca8c003e5314c6b603c8557eff3bf8 (diff) | |
download | mpd-5bcf415ad050e404ab5c74b8398e8e1558bcdb17.tar.gz mpd-5bcf415ad050e404ab5c74b8398e8e1558bcdb17.tar.xz mpd-5bcf415ad050e404ab5c74b8398e8e1558bcdb17.zip |
jack: use jack_port_name() instead of g_malloc()+sprintf()
libjack's jack_port_name() function returns the effective port name,
we don't need to do it manually.
Diffstat (limited to 'src/output/jack_plugin.c')
-rw-r--r-- | src/output/jack_plugin.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c index 8dadec89c..f6d0f9b8c 100644 --- a/src/output/jack_plugin.c +++ b/src/output/jack_plugin.c @@ -215,7 +215,6 @@ static int mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) { const char **jports; - char *port_name; jd->audio_format = audio_format; @@ -267,27 +266,18 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) } if ( jd->output_ports[1] ) { - const char *name = mpd_jack_name(jd); - - port_name = g_malloc(sizeof(port_name[0]) * (7 + strlen(name))); - - sprintf(port_name, "%s:left", name); - if ( (jack_connect(jd->client, port_name, + if ( (jack_connect(jd->client, jack_port_name(jd->ports[0]), jd->output_ports[0])) != 0 ) { g_warning("%s is not a valid Jack Client / Port", jd->output_ports[0]); - g_free(port_name); return -1; } - sprintf(port_name, "%s:right", name); - if ( (jack_connect(jd->client, port_name, + if ( (jack_connect(jd->client, jack_port_name(jd->ports[0]), jd->output_ports[1])) != 0 ) { g_warning("%s is not a valid Jack Client / Port", jd->output_ports[1]); - g_free(port_name); return -1; } - g_free(port_name); } return 1; |