aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_list.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-06-12 21:09:40 +0200
committerMax Kellermann <max@duempel.org>2012-06-12 21:15:46 +0200
commitd2d9b45a8189b7771e1b7dfbe7d5a550fcf400b8 (patch)
tree6e1653ab8cd563dd2e6c326d99fecda34d202fe6 /src/decoder_list.c
parent9ebbdb9b0b288164ce956ba34bc0c38f94868110 (diff)
downloadmpd-d2d9b45a8189b7771e1b7dfbe7d5a550fcf400b8.tar.gz
mpd-d2d9b45a8189b7771e1b7dfbe7d5a550fcf400b8.tar.xz
mpd-d2d9b45a8189b7771e1b7dfbe7d5a550fcf400b8.zip
decoder_list: add _for_each() macros
Diffstat (limited to 'src/decoder_list.c')
-rw-r--r--src/decoder_list.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/decoder_list.c b/src/decoder_list.c
index d76050023..c3fd363c0 100644
--- a/src/decoder_list.c
+++ b/src/decoder_list.c
@@ -174,12 +174,9 @@ decoder_plugin_from_mime_type(const char *mimeType, unsigned int next)
const struct decoder_plugin *
decoder_plugin_from_name(const char *name)
{
- for (unsigned i = 0; decoder_plugins[i] != NULL; ++i) {
- const struct decoder_plugin *plugin = decoder_plugins[i];
- if (decoder_plugins_enabled[i] &&
- strcmp(plugin->name, name) == 0)
+ decoder_plugins_for_each_enabled(plugin)
+ if (strcmp(plugin->name, name) == 0)
return plugin;
- }
return NULL;
}
@@ -227,10 +224,6 @@ void decoder_plugin_init_all(void)
void decoder_plugin_deinit_all(void)
{
- for (unsigned i = 0; decoder_plugins[i] != NULL; ++i) {
- const struct decoder_plugin *plugin = decoder_plugins[i];
-
- if (decoder_plugins_enabled[i])
- decoder_plugin_finish(plugin);
- }
+ decoder_plugins_for_each_enabled(plugin)
+ decoder_plugin_finish(plugin);
}