aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_list.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 /src/playlist_list.c
parentd000d31355c824a076324b647a3f056aab9ddabe (diff)
downloadmpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.gz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.xz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.zip
input_stream: return errors with GError
Diffstat (limited to 'src/playlist_list.c')
-rw-r--r--src/playlist_list.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/playlist_list.c b/src/playlist_list.c
index 2ea174a2f..1ac4d4358 100644
--- a/src/playlist_list.c
+++ b/src/playlist_list.c
@@ -159,7 +159,7 @@ playlist_list_open_stream_mime(struct input_stream *is)
string_array_contains(plugin->mime_types, is->mime)) {
/* rewind the stream, so each plugin gets a
fresh start */
- input_stream_seek(is, 0, SEEK_SET);
+ input_stream_seek(is, 0, SEEK_SET, NULL);
playlist = playlist_plugin_open_stream(plugin, is);
if (playlist != NULL)
@@ -185,7 +185,7 @@ 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);
+ input_stream_seek(is, 0, SEEK_SET, NULL);
playlist = playlist_plugin_open_stream(plugin, is);
if (playlist != NULL)
@@ -237,16 +237,25 @@ playlist_suffix_supported(const char *suffix)
struct playlist_provider *
playlist_list_open_path(struct input_stream *is, const char *path_fs)
{
+ GError *error = NULL;
const char *suffix;
struct playlist_provider *playlist;
assert(path_fs != NULL);
suffix = uri_get_suffix(path_fs);
- if (suffix == NULL || !playlist_suffix_supported(suffix) ||
- !input_stream_open(is, path_fs))
+ if (suffix == NULL || !playlist_suffix_supported(suffix))
return NULL;
+ if (!input_stream_open(is, path_fs, &error)) {
+ if (error != NULL) {
+ g_warning("%s", error->message);
+ g_error_free(error);
+ }
+
+ return NULL;
+ }
+
playlist = playlist_list_open_stream_suffix(is, suffix);
if (playlist == NULL)
input_stream_close(is);