summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-08-19 22:40:36 +0200
committerMax Kellermann <max@musicpd.org>2018-08-19 22:40:36 +0200
commitdafa3f985a1aaafde6fa5f7e9d3277b21521b37b (patch)
tree9a59521b3fe3fbb3ddb5be7836b1cd74c3c59f81
parentf865e1393c32e1772356cabd11515f254f498915 (diff)
test/run_decoder: allocate ConfigData in class GlobalInit
-rw-r--r--test/run_decoder.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx
index e7e395432..9136d8c86 100644
--- a/test/run_decoder.cxx
+++ b/test/run_decoder.cxx
@@ -18,7 +18,9 @@
*/
#include "config.h"
-#include "config/Global.hxx"
+#include "config/File.hxx"
+#include "config/Migrate.hxx"
+#include "config/Data.hxx"
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
@@ -87,20 +89,23 @@ ParseCommandLine(int argc, char **argv)
}
class GlobalInit {
+ ConfigData config;
EventThread io_thread;
public:
GlobalInit(Path config_path, bool verbose) {
SetLogThreshold(verbose ? LogLevel::DEBUG : LogLevel::INFO);
- io_thread.Start();
+ if (!config_path.IsNull()) {
+ ReadConfigFile(config, config_path);
+ Migrate(config);
+ }
- if (!config_path.IsNull())
- ReadConfigFile(config_path);
+ io_thread.Start();
- input_stream_global_init(GetGlobalConfig(),
+ input_stream_global_init(config,
io_thread.GetEventLoop());
- decoder_plugin_init_all(GetGlobalConfig());
+ decoder_plugin_init_all(config);
}
~GlobalInit() {