aboutsummaryrefslogtreecommitdiffstats
path: root/test/dump_playlist.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/dump_playlist.cxx')
-rw-r--r--test/dump_playlist.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx
index 768eee367..c3cdf638f 100644
--- a/test/dump_playlist.cxx
+++ b/test/dump_playlist.cxx
@@ -30,6 +30,7 @@
#include "PlaylistRegistry.hxx"
#include "PlaylistPlugin.hxx"
#include "fs/Path.hxx"
+#include "util/Error.hxx"
#include <glib.h>
@@ -84,7 +85,8 @@ decoder_read(gcc_unused struct decoder *decoder,
struct input_stream *is,
void *buffer, size_t length)
{
- return input_stream_lock_read(is, buffer, length, NULL);
+ Error error;
+ return input_stream_lock_read(is, buffer, length, error);
}
void
@@ -139,7 +141,6 @@ int main(int argc, char **argv)
{
const char *uri;
struct input_stream *is = NULL;
- GError *error = NULL;
struct playlist_provider *playlist;
Song *song;
@@ -162,18 +163,18 @@ int main(int argc, char **argv)
/* initialize MPD */
config_global_init();
- if (!ReadConfigFile(config_path, &error)) {
- g_printerr("%s\n", error->message);
- g_error_free(error);
+
+ Error error;
+ if (!ReadConfigFile(config_path, error)) {
+ g_printerr("%s\n", error.GetMessage());
return 1;
}
io_thread_init();
io_thread_start();
- if (!input_stream_global_init(&error)) {
- g_warning("%s", error->message);
- g_error_free(error);
+ if (!input_stream_global_init(error)) {
+ g_warning("%s", error.GetMessage());
return 2;
}
@@ -189,12 +190,11 @@ int main(int argc, char **argv)
if (playlist == NULL) {
/* open the stream and wait until it becomes ready */
- is = input_stream_open(uri, mutex, cond, &error);
+ is = input_stream_open(uri, mutex, cond, error);
if (is == NULL) {
- if (error != NULL) {
- g_warning("%s", error->message);
- g_error_free(error);
- } else
+ if (error.IsDefined())
+ g_warning("%s", error.GetMessage());
+ else
g_printerr("input_stream_open() failed\n");
return 2;
}