test/run_decoder: allocate ConfigData in class GlobalInit
This commit is contained in:
parent
f865e1393c
commit
dafa3f985a
@ -18,7 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "config/Global.hxx"
|
#include "config/File.hxx"
|
||||||
|
#include "config/Migrate.hxx"
|
||||||
|
#include "config/Data.hxx"
|
||||||
#include "event/Thread.hxx"
|
#include "event/Thread.hxx"
|
||||||
#include "decoder/DecoderList.hxx"
|
#include "decoder/DecoderList.hxx"
|
||||||
#include "decoder/DecoderPlugin.hxx"
|
#include "decoder/DecoderPlugin.hxx"
|
||||||
@ -87,20 +89,23 @@ ParseCommandLine(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GlobalInit {
|
class GlobalInit {
|
||||||
|
ConfigData config;
|
||||||
EventThread io_thread;
|
EventThread io_thread;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GlobalInit(Path config_path, bool verbose) {
|
GlobalInit(Path config_path, bool verbose) {
|
||||||
SetLogThreshold(verbose ? LogLevel::DEBUG : LogLevel::INFO);
|
SetLogThreshold(verbose ? LogLevel::DEBUG : LogLevel::INFO);
|
||||||
|
|
||||||
|
if (!config_path.IsNull()) {
|
||||||
|
ReadConfigFile(config, config_path);
|
||||||
|
Migrate(config);
|
||||||
|
}
|
||||||
|
|
||||||
io_thread.Start();
|
io_thread.Start();
|
||||||
|
|
||||||
if (!config_path.IsNull())
|
input_stream_global_init(config,
|
||||||
ReadConfigFile(config_path);
|
|
||||||
|
|
||||||
input_stream_global_init(GetGlobalConfig(),
|
|
||||||
io_thread.GetEventLoop());
|
io_thread.GetEventLoop());
|
||||||
decoder_plugin_init_all(GetGlobalConfig());
|
decoder_plugin_init_all(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
~GlobalInit() {
|
~GlobalInit() {
|
||||||
|
Loading…
Reference in New Issue
Block a user