diff options
author | Max Kellermann <max@duempel.org> | 2009-12-30 23:27:37 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-01 17:25:07 +0100 |
commit | d3b763a48c09a60a0c0b5ccb6cccd9376875c470 (patch) | |
tree | 83b8794f78ef8941806cf5757888d8abf2eaa126 /src/playlist_list.c | |
parent | 816b6ad4a71c3ade95e62b62396f2b0415c03f20 (diff) | |
download | mpd-d3b763a48c09a60a0c0b5ccb6cccd9376875c470.tar.gz mpd-d3b763a48c09a60a0c0b5ccb6cccd9376875c470.tar.xz mpd-d3b763a48c09a60a0c0b5ccb6cccd9376875c470.zip |
input_stream: return allocated input_stream objects
Major API redesign: don't let the caller allocate the input_stream
object. Let each input plugin allocate its own (derived/extended)
input_stream pointer. The "data" attribute can now be removed, and
all input plugins simply cast the input_stream pointer to their own
structure (with an "struct input_stream base" as the first attribute).
Diffstat (limited to 'src/playlist_list.c')
-rw-r--r-- | src/playlist_list.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/playlist_list.c b/src/playlist_list.c index 46fd238c1..d034f4c1e 100644 --- a/src/playlist_list.c +++ b/src/playlist_list.c @@ -293,10 +293,11 @@ playlist_suffix_supported(const char *suffix) } struct playlist_provider * -playlist_list_open_path(struct input_stream *is, const char *path_fs) +playlist_list_open_path(const char *path_fs) { GError *error = NULL; const char *suffix; + struct input_stream *is; struct playlist_provider *playlist; assert(path_fs != NULL); @@ -305,7 +306,8 @@ playlist_list_open_path(struct input_stream *is, const char *path_fs) if (suffix == NULL || !playlist_suffix_supported(suffix)) return NULL; - if (!input_stream_open(is, path_fs, &error)) { + is = input_stream_open(path_fs, &error); + if (is == NULL) { if (error != NULL) { g_warning("%s", error->message); g_error_free(error); |