diff options
author | Max Kellermann <max@duempel.org> | 2009-02-11 18:00:41 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-11 18:00:41 +0100 |
commit | 5090cf6484f5e7464aeba54d19500cc334a80fad (patch) | |
tree | 1e6cc079a0b23128a529aea3f6042581027828c9 /src/output | |
parent | 5484aaee5f9407e61d77e81236b4942c12b94556 (diff) | |
download | mpd-5090cf6484f5e7464aeba54d19500cc334a80fad.tar.gz mpd-5090cf6484f5e7464aeba54d19500cc334a80fad.tar.xz mpd-5090cf6484f5e7464aeba54d19500cc334a80fad.zip |
audio: replaced parseAudioConfig() with audio_format_parse()
Added audio_format_parse() in a separate library, with a modern
interface: return a GError instead of logging errors. This allows the
caller to deal with the error.
Diffstat (limited to '')
-rw-r--r-- | src/output_init.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/output_init.c b/src/output_init.c index a3231f4d2..b7b088396 100644 --- a/src/output_init.c +++ b/src/output_init.c @@ -20,7 +20,7 @@ #include "output_api.h" #include "output_internal.h" #include "output_list.h" -#include "audio.h" +#include "audio_parser.h" #include <glib.h> @@ -94,9 +94,14 @@ audio_output_init(struct audio_output *ao, const struct config_param *param) pcm_convert_init(&ao->convert_state); if (format) { - if (0 != parseAudioConfig(&ao->config_audio_format, format)) { - g_error("error parsing format at line %i\n", bp->line); - } + GError *error = NULL; + bool ret; + + ret = audio_format_parse(&ao->config_audio_format, format, + &error); + if (!ret) + g_error("error parsing format at line %i: %s", + bp->line, error->message); } else audio_format_clear(&ao->config_audio_format); |