From f298fcf3a651b9c072f1fa7242b4ff30141c6fe5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Mar 2009 13:31:56 +0100 Subject: output_init: return GError on error Do error handling with GError instead of aborting with g_error(). --- src/output_all.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/output_all.c') diff --git a/src/output_all.c b/src/output_all.c index 953a11bd5..e360fd5ae 100644 --- a/src/output_all.c +++ b/src/output_all.c @@ -77,6 +77,7 @@ audio_output_all_init(void) { const struct config_param *param = NULL; unsigned int i; + GError *error = NULL; notify_init(&audio_output_client_notify); @@ -93,18 +94,8 @@ audio_output_all_init(void) /* only allow param to be NULL if there just one audioOutput */ assert(param || (num_audio_outputs == 1)); - if (!audio_output_init(output, param)) { - if (param) - { - g_error("problems configuring output device " - "defined at line %i\n", param->line); - } - else - { - g_error("No audio_output specified and unable to " - "detect a default audio output device\n"); - } - } + if (!audio_output_init(output, param, &error)) + g_error("line %i: %s", param->line, error->message); /* require output names to be unique: */ for (j = 0; j < i; j++) { -- cgit v1.2.3