diff options
author | Max Kellermann <max@duempel.org> | 2009-02-28 15:29:51 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-28 15:29:51 +0100 |
commit | 5ea8a0df3ff159d1c9879b4a3a4c56ff34f0e43f (patch) | |
tree | fb29f79ec8b2ae0eb25d481e7fb84a47b2c41c0e /src/decoder_list.c | |
parent | 1bb0124b77a21ab560c1b0d0a67259b6979648d7 (diff) | |
download | mpd-5ea8a0df3ff159d1c9879b4a3a4c56ff34f0e43f.tar.gz mpd-5ea8a0df3ff159d1c9879b4a3a4c56ff34f0e43f.tar.xz mpd-5ea8a0df3ff159d1c9879b4a3a4c56ff34f0e43f.zip |
decoder_list: print decoder list with suffixes
Print the list of suffixes supported by each decoder, instead of
prining a list of all suffixes of all decoders with duplicates.
Diffstat (limited to '')
-rw-r--r-- | src/decoder_list.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/decoder_list.c b/src/decoder_list.c index 9ed5fc560..4cf373a03 100644 --- a/src/decoder_list.c +++ b/src/decoder_list.c @@ -154,36 +154,25 @@ decoder_plugin_from_name(const char *name) return NULL; } -void decoder_plugin_print_all_suffixes(FILE * fp) +void decoder_plugin_print_all_decoders(FILE * fp) { - const char *const*suffixes; - for (unsigned i = 0; i < num_decoder_plugins; ++i) { const struct decoder_plugin *plugin = decoder_plugins[i]; + const char *const*suffixes; + if (!decoder_plugins_enabled[i]) continue; - suffixes = plugin->suffixes; - while (suffixes && *suffixes) { - fprintf(fp, "%s ", *suffixes); - suffixes++; - } - } - fprintf(fp, "\n"); - fflush(fp); -} + fprintf(fp, "[%s]", plugin->name); -void decoder_plugin_print_all_decoders(FILE * fp) -{ - for (unsigned i = 0; i < num_decoder_plugins; ++i) { - const struct decoder_plugin *plugin = decoder_plugins[i]; - if (!decoder_plugins_enabled[i]) - continue; + for (suffixes = plugin->suffixes; + suffixes != NULL && *suffixes != NULL; + ++suffixes) { + fprintf(fp, " %s", *suffixes); + } - fprintf(fp, "%s ", plugin->name); + fprintf(fp, "\n"); } - fprintf(fp, "\n"); - fflush(fp); } /** |