diff options
author | Max Kellermann <max@duempel.org> | 2009-01-30 00:40:14 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-30 00:40:14 +0100 |
commit | dc1cc7e7e52960cceea5514397ec33f7ffc0dd6d (patch) | |
tree | a76aba35426426992ebfa3c58d0e348b5152658b /src/input_stream.c | |
parent | 297101c3f869abe02aeb642774f6c82b75fcfe81 (diff) | |
download | mpd-dc1cc7e7e52960cceea5514397ec33f7ffc0dd6d.tar.gz mpd-dc1cc7e7e52960cceea5514397ec33f7ffc0dd6d.tar.xz mpd-dc1cc7e7e52960cceea5514397ec33f7ffc0dd6d.zip |
input_stream: let the implementation assign is->plugin
This way, plugins can manipulate the plugin pointer during open().
Diffstat (limited to '')
-rw-r--r-- | src/input_stream.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input_stream.c b/src/input_stream.c index 234511e7f..b25f3bf40 100644 --- a/src/input_stream.c +++ b/src/input_stream.c @@ -80,7 +80,13 @@ input_stream_open(struct input_stream *is, const char *url) const struct input_plugin *plugin = input_plugins[i]; if (plugin->open(is, url)) { - is->plugin = plugin; + assert(is->plugin != NULL); + assert(is->plugin->open == NULL || + is->plugin == plugin); + assert(is->plugin->close != NULL); + assert(is->plugin->read != NULL); + assert(is->plugin->eof != NULL); + return true; } } |