aboutsummaryrefslogtreecommitdiffstats
path: root/test/dump_playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-14 23:53:04 +0100
committerMax Kellermann <max@duempel.org>2009-12-15 23:12:11 +0100
commit228b03edf8513aa1cdaf4e4647279cc580245555 (patch)
tree7f5b03a9727fb8c371885469296eb7f49f6fa68b /test/dump_playlist.c
parentd000d31355c824a076324b647a3f056aab9ddabe (diff)
downloadmpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.gz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.xz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.zip
input_stream: return errors with GError
Diffstat (limited to '')
-rw-r--r--test/dump_playlist.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/dump_playlist.c b/test/dump_playlist.c
index fba9498a7..bf31400fe 100644
--- a/test/dump_playlist.c
+++ b/test/dump_playlist.c
@@ -88,17 +88,24 @@ int main(int argc, char **argv)
if (playlist == NULL) {
/* open the stream and wait until it becomes ready */
- success = input_stream_open(&is, uri);
+ success = input_stream_open(&is, uri, &error);
if (!success) {
- g_printerr("input_stream_open() failed\n");
+ if (error != NULL) {
+ g_warning("%s", error->message);
+ g_error_free(error);
+ } else
+ g_printerr("input_stream_open() failed\n");
return 2;
}
while (!is.ready) {
- int ret = input_stream_buffer(&is);
- if (ret < 0)
+ int ret = input_stream_buffer(&is, &error);
+ if (ret < 0) {
/* error */
+ g_warning("%s", error->message);
+ g_error_free(error);
return 2;
+ }
if (ret == 0)
/* nothing was buffered - wait */