summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-12-03 13:15:56 +0100
committerMax Kellermann <max@musicpd.org>2016-12-10 00:03:29 +0100
commit94e9e93fa42264dacf5b7b41c2275ab1eea64f77 (patch)
treee0607552729501a568d4c029771b07fe0327fede /src/Main.cxx
parentd2a1294e9afafb1880db3eb382a958b08065e719 (diff)
ReplayGainGlobal: move replay_gain_config into struct Config
Yet another global variable removed.
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 3f3acf280..9360fd898 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -128,13 +128,14 @@ Context *context;
Instance *instance;
struct Config {
+ ReplayGainConfig replay_gain;
};
gcc_const
static Config
LoadConfig()
{
- return {};
+ return {LoadReplayGainConfig()};
}
#ifdef ENABLE_DAEMON
@@ -290,7 +291,7 @@ static void winsock_init(void)
* Initialize the decoder and player core, including the music pipe.
*/
static void
-initialize_decoder_and_player(void)
+initialize_decoder_and_player(const ReplayGainConfig &replay_gain_config)
{
const ConfigParam *param;
@@ -443,7 +444,6 @@ try {
stats_global_init();
TagLoadConfig();
- replay_gain_global_init();
log_init(options.verbose, options.log_stderr);
@@ -463,7 +463,7 @@ try {
config_get_positive(ConfigOption::MAX_CONN, 10);
instance->client_list = new ClientList(max_clients);
- initialize_decoder_and_player();
+ initialize_decoder_and_player(config.replay_gain);
listen_global_init(instance->event_loop, *instance->partition);
@@ -495,8 +495,6 @@ try {
static int
mpd_main_after_fork(const Config &config)
try {
- (void)config;
-
ConfigureFS();
glue_mapper_init();
@@ -518,8 +516,9 @@ try {
glue_sticker_init();
command_init();
+
instance->partition->outputs.Configure(instance->event_loop,
- replay_gain_config,
+ config.replay_gain,
instance->partition->pc);
client_manager_init();
input_stream_global_init();