DecoderThread: simplify the decoder lookup loop

Merge the two loops into one, and eliminate the GSList.
This commit is contained in:
Max Kellermann
2013-10-21 22:14:08 +02:00
parent 74904b9cf2
commit f6d67ac260
2 changed files with 54 additions and 65 deletions
+11
View File
@@ -61,6 +61,17 @@ decoder_plugins_find(F f)
return nullptr;
}
template<typename F>
static inline bool
decoder_plugins_try(F f)
{
for (unsigned i = 0; decoder_plugins[i] != nullptr; ++i)
if (decoder_plugins_enabled[i] && f(*decoder_plugins[i]))
return true;
return false;
}
template<typename F>
static inline void
decoder_plugins_for_each(F f)