summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-07-17 21:31:06 +0200
committerMax Kellermann <max@musicpd.org>2018-07-17 22:05:21 +0200
commit57d77cc8a05835b2d1a33f1cec5adcc46a196981 (patch)
tree0e3f23ddfde6e9aed97888a9a13ee85e931537e4
parent9fe05850565cad69ce21a2ba7a5daf8c310ea0da (diff)
decoder/List: use struct ConfigData
-rw-r--r--src/Main.cxx2
-rw-r--r--src/decoder/DecoderList.cxx9
-rw-r--r--src/decoder/DecoderList.hxx3
-rw-r--r--test/ContainerScan.cxx3
-rw-r--r--test/dump_playlist.cxx2
-rw-r--r--test/read_tags.cxx3
-rw-r--r--test/run_decoder.cxx2
7 files changed, 14 insertions, 10 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 536f2ac90..c13e84dda 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -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();
diff --git a/src/decoder/DecoderList.cxx b/src/decoder/DecoderList.cxx
index 7f1bafe7a..c3fcc9be4 100644
--- a/src/decoder/DecoderList.cxx
+++ b/src/decoder/DecoderList.cxx
@@ -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 = &empty;
diff --git a/src/decoder/DecoderList.hxx b/src/decoder/DecoderList.hxx
index 2eb9aa231..bbb42d4bb 100644
--- a/src/decoder/DecoderList.hxx
+++ b/src/decoder/DecoderList.hxx
@@ -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
diff --git a/test/ContainerScan.cxx b/test/ContainerScan.cxx
index 18ac77493..7c92f1a74 100644
--- a/test/ContainerScan.cxx
+++ b/test/ContainerScan.cxx
@@ -20,6 +20,7 @@
#include "config.h"
#include "DetachedSong.hxx"
#include "SongSave.hxx"
+#include "config/Data.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "fs/Path.hxx"
@@ -68,7 +69,7 @@ try {
const Path path = Path::FromFS(argv[1]);
- decoder_plugin_init_all();
+ decoder_plugin_init_all(ConfigData());
const auto *plugin = FindContainerDecoderPlugin(path);
if (plugin == nullptr) {
diff --git a/test/dump_playlist.cxx b/test/dump_playlist.cxx
index f5fdb1885..0a0aabda4 100644
--- a/test/dump_playlist.cxx
+++ b/test/dump_playlist.cxx
@@ -69,7 +69,7 @@ try {
input_stream_global_init(io_thread.GetEventLoop());
playlist_list_global_init();
- decoder_plugin_init_all();
+ decoder_plugin_init_all(GetGlobalConfig());
/* open the playlist */
diff --git a/test/read_tags.cxx b/test/read_tags.cxx
index 6d18eb67f..b88cc204f 100644
--- a/test/read_tags.cxx
+++ b/test/read_tags.cxx
@@ -18,6 +18,7 @@
*/
#include "config.h"
+#include "config/Data.hxx"
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
@@ -95,7 +96,7 @@ try {
input_stream_global_init(io_thread.GetEventLoop());
AtScopeExit() { input_stream_global_finish(); };
- decoder_plugin_init_all();
+ decoder_plugin_init_all(ConfigData());
AtScopeExit() { decoder_plugin_deinit_all(); };
plugin = decoder_plugin_from_name(decoder_name);
diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx
index aa1a809c9..e1a353b92 100644
--- a/test/run_decoder.cxx
+++ b/test/run_decoder.cxx
@@ -99,7 +99,7 @@ public:
ReadConfigFile(config_path);
input_stream_global_init(io_thread.GetEventLoop());
- decoder_plugin_init_all();
+ decoder_plugin_init_all(GetGlobalConfig());
}
~GlobalInit() {