aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/pulse_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-18 19:37:27 +0100
committerMax Kellermann <max@duempel.org>2009-01-18 19:37:27 +0100
commita531a1e65075d27574bc31d4bac7ab20cb750efd (patch)
treef06ad8e7359f0845d94d2b8a6f655a0cceb744c2 /src/output/pulse_plugin.c
parent73e466cfef6497aff840cfac35d80d74e7b0fd0c (diff)
downloadmpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.tar.gz
mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.tar.xz
mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.zip
conf: added config_get_block_string()
This replaces lots of getBlockParam() invocations.
Diffstat (limited to 'src/output/pulse_plugin.c')
-rw-r--r--src/output/pulse_plugin.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/output/pulse_plugin.c b/src/output/pulse_plugin.c
index 7d746378c..45710b4a9 100644
--- a/src/output/pulse_plugin.c
+++ b/src/output/pulse_plugin.c
@@ -57,19 +57,14 @@ pulse_init(struct audio_output *ao,
G_GNUC_UNUSED const struct audio_format *audio_format,
struct config_param *param)
{
- struct block_param *server = NULL;
- struct block_param *sink = NULL;
struct pulse_data *pd;
- if (param) {
- server = getBlockParam(param, "server");
- sink = getBlockParam(param, "sink");
- }
-
pd = pulse_new_data();
pd->ao = ao;
- pd->server = server != NULL ? g_strdup(server->value) : NULL;
- pd->sink = sink != NULL ? g_strdup(sink->value) : NULL;
+ pd->server = param != NULL
+ ? config_dup_block_string(param, "server", NULL) : NULL;
+ pd->sink = param != NULL
+ ? config_dup_block_string(param, "sink", NULL) : NULL;
return pd;
}