input_plugin: added methods init(), finish()

Instead of hard-coding the plugin global initialization in
input_stream_global_init(), make it walk the plugin list and
initialize all plugins.
This commit is contained in:
Max Kellermann
2009-03-02 20:45:50 +01:00
parent 36d24fb7ea
commit 9a350acf04
4 changed files with 35 additions and 13 deletions

View File

@@ -28,6 +28,20 @@
struct input_stream;
struct input_plugin {
/**
* Global initialization. This method is called when MPD starts.
*
* @return true on success, false if the plugin should be
* disabled
*/
bool (*init)(void);
/**
* Global deinitialization. Called once before MPD shuts
* down (only if init() has returned true).
*/
void (*finish)(void);
bool (*open)(struct input_stream *is, const char *url);
void (*close)(struct input_stream *is);