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
e8310211
Commit
e8310211
authored
May 30, 2010
by
Daniel Seuthe
Committed by
Max Kellermann
May 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter/replay_gain: added option "replaygain_limit"
parent
3709b9aa
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
14 deletions
+26
-14
conf.c
src/conf.c
+1
-0
conf.h
src/conf.h
+1
-0
decoder_api.c
src/decoder_api.c
+2
-1
replay_gain_filter_plugin.c
src/filter/replay_gain_filter_plugin.c
+2
-5
replay_gain_config.c
src/replay_gain_config.c
+5
-0
replay_gain_config.h
src/replay_gain_config.h
+1
-0
replay_gain_info.c
src/replay_gain_info.c
+13
-7
replay_gain_info.h
src/replay_gain_info.h
+1
-1
No files found.
src/conf.c
View file @
e8310211
...
...
@@ -72,6 +72,7 @@ static struct config_entry config_entries[] = {
{
.
name
=
CONF_REPLAYGAIN
,
false
,
false
},
{
.
name
=
CONF_REPLAYGAIN_PREAMP
,
false
,
false
},
{
.
name
=
CONF_REPLAYGAIN_MISSING_PREAMP
,
false
,
false
},
{
.
name
=
CONF_REPLAYGAIN_LIMIT
,
false
,
false
},
{
.
name
=
CONF_VOLUME_NORMALIZATION
,
false
,
false
},
{
.
name
=
CONF_SAMPLERATE_CONVERTER
,
false
,
false
},
{
.
name
=
CONF_AUDIO_BUFFER_SIZE
,
false
,
false
},
...
...
src/conf.h
View file @
e8310211
...
...
@@ -48,6 +48,7 @@
#define CONF_REPLAYGAIN "replaygain"
#define CONF_REPLAYGAIN_PREAMP "replaygain_preamp"
#define CONF_REPLAYGAIN_MISSING_PREAMP "replaygain_missing_preamp"
#define CONF_REPLAYGAIN_LIMIT "replaygain_limit"
#define CONF_VOLUME_NORMALIZATION "volume_normalization"
#define CONF_SAMPLERATE_CONVERTER "samplerate_converter"
#define CONF_AUDIO_BUFFER_SIZE "audio_buffer_size"
...
...
src/decoder_api.c
View file @
e8310211
...
...
@@ -420,7 +420,8 @@ decoder_replay_gain(struct decoder *decoder,
return_db
=
20
.
0
*
log10f
(
replay_gain_tuple_scale
(
&
replay_gain_info
->
tuples
[
replay_gain_get_real_mode
()],
replay_gain_preamp
));
replay_gain_preamp
,
replay_gain_missing_preamp
,
replay_gain_limit
));
}
decoder
->
replay_gain_info
=
*
replay_gain_info
;
...
...
src/filter/replay_gain_filter_plugin.c
View file @
e8310211
...
...
@@ -78,11 +78,8 @@ static void
replay_gain_filter_update
(
struct
replay_gain_filter
*
filter
)
{
if
(
filter
->
mode
!=
REPLAY_GAIN_OFF
)
{
const
struct
replay_gain_tuple
*
tuple
=
&
filter
->
info
.
tuples
[
filter
->
mode
];
float
scale
=
replay_gain_tuple_defined
(
tuple
)
?
replay_gain_tuple_scale
(
tuple
,
replay_gain_preamp
)
:
replay_gain_missing_preamp
;
float
scale
=
replay_gain_tuple_scale
(
&
filter
->
info
.
tuples
[
filter
->
mode
],
replay_gain_preamp
,
replay_gain_missing_preamp
,
replay_gain_limit
);
g_debug
(
"scale=%f
\n
"
,
(
double
)
scale
);
filter
->
volume
=
pcm_float_to_volume
(
scale
);
...
...
src/replay_gain_config.c
View file @
e8310211
...
...
@@ -37,8 +37,11 @@ static const char *const replay_gain_mode_names[] = {
enum
replay_gain_mode
replay_gain_mode
=
REPLAY_GAIN_OFF
;
const
bool
DEFAULT_REPLAYGAIN_LIMIT
=
true
;
float
replay_gain_preamp
=
1
.
0
;
float
replay_gain_missing_preamp
=
1
.
0
;
bool
replay_gain_limit
;
const
char
*
replay_gain_get_mode_string
(
void
)
...
...
@@ -129,6 +132,8 @@ void replay_gain_global_init(void)
replay_gain_missing_preamp
=
pow
(
10
,
f
/
20
.
0
);
}
replay_gain_limit
=
config_get_bool
(
CONF_REPLAYGAIN_LIMIT
,
DEFAULT_REPLAYGAIN_LIMIT
);
}
enum
replay_gain_mode
replay_gain_get_real_mode
(
void
)
...
...
src/replay_gain_config.h
View file @
e8310211
...
...
@@ -28,6 +28,7 @@
extern
enum
replay_gain_mode
replay_gain_mode
;
extern
float
replay_gain_preamp
;
extern
float
replay_gain_missing_preamp
;
extern
bool
replay_gain_limit
;
void
replay_gain_global_init
(
void
);
...
...
src/replay_gain_info.c
View file @
e8310211
...
...
@@ -21,17 +21,23 @@
#include "replay_gain_info.h"
float
replay_gain_tuple_scale
(
const
struct
replay_gain_tuple
*
tuple
,
float
preamp
)
replay_gain_tuple_scale
(
const
struct
replay_gain_tuple
*
tuple
,
float
preamp
,
float
missing_preamp
,
bool
peak_limit
)
{
float
scale
;
scale
=
pow
(
10
.
0
,
tuple
->
gain
/
20
.
0
);
scale
*=
preamp
;
if
(
scale
>
15
.
0
)
scale
=
15
.
0
;
if
(
replay_gain_tuple_defined
(
tuple
))
{
scale
=
pow
(
10
.
0
,
tuple
->
gain
/
20
.
0
);
scale
*=
preamp
;
if
(
scale
>
15
.
0
)
scale
=
15
.
0
;
if
(
scale
*
tuple
->
peak
>
1
.
0
)
scale
=
1
.
0
/
tuple
->
peak
;
if
(
peak_limit
)
if
(
scale
*
tuple
->
peak
>
1
.
0
)
scale
=
1
.
0
/
tuple
->
peak
;
}
else
{
scale
=
missing_preamp
;
}
return
scale
;
}
...
...
src/replay_gain_info.h
View file @
e8310211
...
...
@@ -62,7 +62,7 @@ replay_gain_tuple_defined(const struct replay_gain_tuple *tuple)
}
float
replay_gain_tuple_scale
(
const
struct
replay_gain_tuple
*
tuple
,
float
preamp
);
replay_gain_tuple_scale
(
const
struct
replay_gain_tuple
*
tuple
,
float
preamp
,
float
missing_preamp
,
bool
peak_limit
);
/**
* Attempt to auto-complete missing data. In particular, if album
...
...
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