decoder/List: use struct ConfigData
This commit is contained in:
		| @@ -552,7 +552,7 @@ try { | ||||
|  | ||||
| 	pcm_convert_global_init(); | ||||
|  | ||||
| 	decoder_plugin_init_all(); | ||||
| 	decoder_plugin_init_all(GetGlobalConfig()); | ||||
|  | ||||
| #ifdef ENABLE_DATABASE | ||||
| 	const bool create_db = InitDatabaseAndStorage(); | ||||
|   | ||||
| @@ -20,7 +20,7 @@ | ||||
| #include "config.h" | ||||
| #include "DecoderList.hxx" | ||||
| #include "DecoderPlugin.hxx" | ||||
| #include "config/Global.hxx" | ||||
| #include "config/Data.hxx" | ||||
| #include "config/Block.hxx" | ||||
| #include "plugins/AudiofileDecoderPlugin.hxx" | ||||
| #include "plugins/PcmDecoderPlugin.hxx" | ||||
| @@ -127,15 +127,16 @@ decoder_plugin_from_name(const char *name) noexcept | ||||
| 		}); | ||||
| } | ||||
|  | ||||
| void decoder_plugin_init_all(void) | ||||
| void | ||||
| decoder_plugin_init_all(const ConfigData &config) | ||||
| { | ||||
| 	ConfigBlock empty; | ||||
|  | ||||
| 	for (unsigned i = 0; decoder_plugins[i] != nullptr; ++i) { | ||||
| 		const DecoderPlugin &plugin = *decoder_plugins[i]; | ||||
| 		const auto *param = | ||||
| 			config_find_block(ConfigBlockOption::DECODER, "plugin", | ||||
| 					  plugin.name); | ||||
| 			config.FindBlock(ConfigBlockOption::DECODER, "plugin", | ||||
| 					 plugin.name); | ||||
|  | ||||
| 		if (param == nullptr) | ||||
| 			param = ∅ | ||||
|   | ||||
| @@ -22,6 +22,7 @@ | ||||
|  | ||||
| #include "Compiler.h" | ||||
|  | ||||
| struct ConfigData; | ||||
| struct DecoderPlugin; | ||||
|  | ||||
| extern const struct DecoderPlugin *const decoder_plugins[]; | ||||
| @@ -35,7 +36,7 @@ decoder_plugin_from_name(const char *name) noexcept; | ||||
|  | ||||
| /* this is where we "load" all the "plugins" ;-) */ | ||||
| void | ||||
| decoder_plugin_init_all(); | ||||
| decoder_plugin_init_all(const ConfigData &config); | ||||
|  | ||||
| /* this is where we "unload" all the "plugins" */ | ||||
| void | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann