Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
94e9e93f
Commit
94e9e93f
authored
Dec 03, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReplayGainGlobal: move replay_gain_config into struct Config
Yet another global variable removed.
parent
d2a1294e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
Main.cxx
src/Main.cxx
+6
-7
ReplayGainGlobal.cxx
src/ReplayGainGlobal.cxx
+6
-3
ReplayGainGlobal.hxx
src/ReplayGainGlobal.hxx
+2
-4
No files found.
src/Main.cxx
View file @
94e9e93f
...
...
@@ -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
();
...
...
src/ReplayGainGlobal.cxx
View file @
94e9e93f
...
...
@@ -28,8 +28,6 @@
#include <stdlib.h>
#include <math.h>
ReplayGainConfig
replay_gain_config
;
static
float
ParsePreamp
(
const
char
*
s
)
{
...
...
@@ -57,8 +55,11 @@ ParsePreamp(const ConfigParam &p)
}
}
void
replay_gain_global_init
(
void
)
ReplayGainConfig
LoadReplayGainConfig
()
{
ReplayGainConfig
replay_gain_config
;
const
auto
*
param
=
config_get_param
(
ConfigOption
::
REPLAYGAIN_PREAMP
);
if
(
param
)
replay_gain_config
.
preamp
=
ParsePreamp
(
*
param
);
...
...
@@ -69,4 +70,6 @@ void replay_gain_global_init(void)
replay_gain_config
.
limit
=
config_get_bool
(
ConfigOption
::
REPLAYGAIN_LIMIT
,
ReplayGainConfig
::
DEFAULT_LIMIT
);
return
replay_gain_config
;
}
src/ReplayGainGlobal.hxx
View file @
94e9e93f
...
...
@@ -24,9 +24,7 @@
struct
ReplayGainConfig
;
extern
ReplayGainConfig
replay_gain_config
;
void
replay_gain_global_init
();
ReplayGainConfig
LoadReplayGainConfig
();
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment