diff options
author | Max Kellermann <max@duempel.org> | 2011-09-09 22:15:28 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-09 23:01:22 +0200 |
commit | 9f5c938ff3cfe6f264340461c88defa2bb614cb0 (patch) | |
tree | b26252f3da5bd374c15cc9b6b03a8849b398a4e3 /src/output | |
parent | b42a8d236434d7ec63c742d275cd7b75adbe760b (diff) | |
download | mpd-9f5c938ff3cfe6f264340461c88defa2bb614cb0.tar.gz mpd-9f5c938ff3cfe6f264340461c88defa2bb614cb0.tar.xz mpd-9f5c938ff3cfe6f264340461c88defa2bb614cb0.zip |
conf: add config_dup_block_path()
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/fifo_output_plugin.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/output/fifo_output_plugin.c b/src/output/fifo_output_plugin.c index e522ef6b9..708062552 100644 --- a/src/output/fifo_output_plugin.c +++ b/src/output/fifo_output_plugin.c @@ -178,30 +178,25 @@ fifo_open(struct fifo_data *fd, GError **error) static void * fifo_output_init(G_GNUC_UNUSED const struct audio_format *audio_format, const struct config_param *param, - GError **error) + GError **error_r) { struct fifo_data *fd; - char *value, *path; - - value = config_dup_block_string(param, "path", NULL); - if (value == NULL) { - g_set_error(error, fifo_output_quark(), errno, - "No \"path\" parameter specified"); - return NULL; - } - path = parsePath(value, error); - g_free(value); + GError *error = NULL; + char *path = config_dup_block_path(param, "path", &error); if (!path) { - g_prefix_error(error, "Invalid path in line %i: ", - param->line); + if (error != NULL) + g_propagate_error(error_r, error); + else + g_set_error(error_r, fifo_output_quark(), 0, + "No \"path\" parameter specified"); return NULL; } fd = fifo_data_new(); fd->path = path; - if (!fifo_open(fd, error)) { + if (!fifo_open(fd, error_r)) { fifo_data_free(fd); return NULL; } |