diff options
author | Max Kellermann <max@duempel.org> | 2009-12-16 21:23:20 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-16 22:16:47 +0100 |
commit | 843717d25c5cf36cb3f8571c72b160f427441cb2 (patch) | |
tree | 98b11cc152ec0e8167abf8f9efca78edbb082952 /src | |
parent | 50ea6a4b5c7ee1229b442c046cd9200f8262d8f7 (diff) | |
download | mpd-843717d25c5cf36cb3f8571c72b160f427441cb2.tar.gz mpd-843717d25c5cf36cb3f8571c72b160f427441cb2.tar.xz mpd-843717d25c5cf36cb3f8571c72b160f427441cb2.zip |
playlist_list: check if open method is present
Use open_uri() / open_stream() only after checking that they are
implemented.
Diffstat (limited to 'src')
-rw-r--r-- | src/playlist_list.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/playlist_list.c b/src/playlist_list.c index 1ac4d4358..175003c19 100644 --- a/src/playlist_list.c +++ b/src/playlist_list.c @@ -131,7 +131,8 @@ playlist_list_open_uri(const char *uri) for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) { const struct playlist_plugin *plugin = playlist_plugins[i]; - if (playlist_plugins_enabled[i] && plugin->schemes != NULL && + if (playlist_plugins_enabled[i] && plugin->open_uri != NULL && + plugin->schemes != NULL && string_array_contains(plugin->schemes, scheme)) { playlist = playlist_plugin_open_uri(plugin, uri); if (playlist != NULL) @@ -155,6 +156,7 @@ playlist_list_open_stream_mime(struct input_stream *is) const struct playlist_plugin *plugin = playlist_plugins[i]; if (playlist_plugins_enabled[i] && + plugin->open_stream != NULL && plugin->mime_types != NULL && string_array_contains(plugin->mime_types, is->mime)) { /* rewind the stream, so each plugin gets a @@ -181,7 +183,9 @@ playlist_list_open_stream_suffix(struct input_stream *is, const char *suffix) for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) { const struct playlist_plugin *plugin = playlist_plugins[i]; - if (playlist_plugins_enabled[i] && plugin->suffixes != NULL && + if (playlist_plugins_enabled[i] && + plugin->open_stream != NULL && + plugin->suffixes != NULL && string_array_contains(plugin->suffixes, suffix)) { /* rewind the stream, so each plugin gets a fresh start */ |