aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistRegistry.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /src/PlaylistRegistry.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/PlaylistRegistry.cxx')
-rw-r--r--src/PlaylistRegistry.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/PlaylistRegistry.cxx b/src/PlaylistRegistry.cxx
index 79fec4bd9..6f3c9aded 100644
--- a/src/PlaylistRegistry.cxx
+++ b/src/PlaylistRegistry.cxx
@@ -34,6 +34,7 @@
#include "InputLegacy.hxx"
#include "util/UriUtil.hxx"
#include "util/StringUtil.hxx"
+#include "util/Error.hxx"
#include "conf.h"
#include "mpd_error.h"
@@ -219,7 +220,8 @@ playlist_list_open_stream_mime2(struct input_stream *is, const char *mime)
string_array_contains(plugin->mime_types, mime)) {
/* rewind the stream, so each plugin gets a
fresh start */
- input_stream_seek(is, 0, SEEK_SET, NULL);
+ Error error;
+ input_stream_seek(is, 0, SEEK_SET, error);
playlist = playlist_plugin_open_stream(plugin, is);
if (playlist != NULL)
@@ -264,7 +266,8 @@ playlist_list_open_stream_suffix(struct input_stream *is, const char *suffix)
string_array_contains(plugin->suffixes, suffix)) {
/* rewind the stream, so each plugin gets a
fresh start */
- input_stream_seek(is, 0, SEEK_SET, NULL);
+ Error error;
+ input_stream_seek(is, 0, SEEK_SET, error);
playlist = playlist_plugin_open_stream(plugin, is);
if (playlist != NULL)
@@ -318,9 +321,7 @@ struct playlist_provider *
playlist_list_open_path(const char *path_fs, Mutex &mutex, Cond &cond,
struct input_stream **is_r)
{
- GError *error = NULL;
const char *suffix;
- struct input_stream *is;
struct playlist_provider *playlist;
assert(path_fs != NULL);
@@ -329,12 +330,11 @@ playlist_list_open_path(const char *path_fs, Mutex &mutex, Cond &cond,
if (suffix == NULL || !playlist_suffix_supported(suffix))
return NULL;
- is = input_stream_open(path_fs, mutex, cond, &error);
+ Error error;
+ input_stream *is = input_stream_open(path_fs, mutex, cond, error);
if (is == NULL) {
- if (error != NULL) {
- g_warning("%s", error->message);
- g_error_free(error);
- }
+ if (error.IsDefined())
+ g_warning("%s", error.GetMessage());
return NULL;
}