diff options
author | Max Kellermann <max@duempel.org> | 2009-01-18 19:45:51 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-18 19:45:51 +0100 |
commit | 65f2386b39e88fd1ee5af65336e41ba184d31cf2 (patch) | |
tree | 695c14ea66774fda67000c3babeea770cf8d96bf /src/output/jack_plugin.c | |
parent | a531a1e65075d27574bc31d4bac7ab20cb750efd (diff) | |
download | mpd-65f2386b39e88fd1ee5af65336e41ba184d31cf2.tar.gz mpd-65f2386b39e88fd1ee5af65336e41ba184d31cf2.tar.xz mpd-65f2386b39e88fd1ee5af65336e41ba184d31cf2.zip |
conf: added config_get_block_unsigned()
Eliminate some more getBlockParam() invocations.
Diffstat (limited to 'src/output/jack_plugin.c')
-rw-r--r-- | src/output/jack_plugin.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c index 224fcd341..185f73860 100644 --- a/src/output/jack_plugin.c +++ b/src/output/jack_plugin.c @@ -187,9 +187,6 @@ mpd_jack_init(struct audio_output *ao, { struct jack_data *jd; const char *value; - struct block_param *bp; - char *endptr; - int val; jd = mpd_jack_new(); jd->ao = ao; @@ -212,18 +209,8 @@ mpd_jack_init(struct audio_output *ao, g_free(ports); } - if ( (bp = getBlockParam(param, "ringbuffer_size")) ) { - errno = 0; - val = strtol(bp->value, &endptr, 10); - - if ( errno == 0 && endptr != bp->value) { - jd->ringbuffer_size = val < 32768 ? 32768 : val; - g_debug("ringbuffer_size=%d", jd->ringbuffer_size); - } else { - g_error("%s is not a number; ringbuf_size=%d", - bp->value, jd->ringbuffer_size); - } - } + jd->ringbuffer_size = + config_get_block_unsigned(param, "ringbuffer_size", 32768); return jd; } |