diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:09 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:09 +0200 |
commit | 6120635f06ecadcc1ab0d59a54b6842a78e11746 (patch) | |
tree | 0c3f2b0f07a50ea2a75dc1a6e641e0805192be96 /src | |
parent | a68ef497f518c8d7e53ff30733cc749fea505321 (diff) | |
download | mpd-6120635f06ecadcc1ab0d59a54b6842a78e11746.tar.gz mpd-6120635f06ecadcc1ab0d59a54b6842a78e11746.tar.xz mpd-6120635f06ecadcc1ab0d59a54b6842a78e11746.zip |
added decoder_plugin_register()
With the functions decoder_plugin_register() and
decoder_plugin_unregister(), decoder plugins can register a
"secondary" plugin, like the flac input plugin does this for
"oggflac".
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder_api.c | 11 | ||||
-rw-r--r-- | src/decoder_api.h | 4 | ||||
-rw-r--r-- | src/inputPlugins/flac_plugin.c | 3 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c index d933f6c7e..ffc3aa781 100644 --- a/src/decoder_api.c +++ b/src/decoder_api.c @@ -18,6 +18,7 @@ */ #include "decoder_internal.h" +#include "decoder_list.h" #include "audio.h" #include "utils.h" @@ -25,6 +26,16 @@ #include "playerData.h" #include "gcc.h" +void decoder_plugin_register(struct decoder_plugin *plugin) +{ + decoder_plugin_load(plugin); +} + +void decoder_plugin_unregister(struct decoder_plugin *plugin) +{ + decoder_plugin_unload(plugin); +} + void decoder_initialized(struct decoder * decoder, const AudioFormat * audio_format, float total_time) diff --git a/src/decoder_api.h b/src/decoder_api.h index becaaada6..5afa06e77 100644 --- a/src/decoder_api.h +++ b/src/decoder_api.h @@ -87,6 +87,10 @@ struct decoder_plugin { }; +void decoder_plugin_register(struct decoder_plugin *plugin); + +void decoder_plugin_unregister(struct decoder_plugin *plugin); + /** * Opaque handle which the decoder plugin passes to the functions in * this header. diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c index c0456791f..9b1c8d85d 100644 --- a/src/inputPlugins/flac_plugin.c +++ b/src/inputPlugins/flac_plugin.c @@ -22,7 +22,6 @@ #include "../utils.h" #include "../log.h" -#include "../decoder_list.h" /* this code was based on flac123, from flac-tools */ @@ -533,7 +532,7 @@ static int flac_plugin_init(void) INPUT_PLUGIN_STREAM_FILE; oggflacPlugin.suffixes = oggflac_suffixes; oggflacPlugin.mime_types = oggflac_mime_types; - decoder_plugin_load(&oggflacPlugin); + decoder_plugin_register(&oggflacPlugin); return 1; } |