diff options
author | Max Kellermann <max@duempel.org> | 2009-03-01 13:31:56 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-01 13:31:56 +0100 |
commit | f298fcf3a651b9c072f1fa7242b4ff30141c6fe5 (patch) | |
tree | e5a0b55fa7c4ec21ee02c696cee902fa95ce441e /src/output_all.c | |
parent | cb942eeb45e15d6b471625629dcb324e625cfac7 (diff) | |
download | mpd-f298fcf3a651b9c072f1fa7242b4ff30141c6fe5.tar.gz mpd-f298fcf3a651b9c072f1fa7242b4ff30141c6fe5.tar.xz mpd-f298fcf3a651b9c072f1fa7242b4ff30141c6fe5.zip |
output_init: return GError on error
Do error handling with GError instead of aborting with g_error().
Diffstat (limited to 'src/output_all.c')
-rw-r--r-- | src/output_all.c | 15 |
1 files changed, 3 insertions, 12 deletions
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++) { |