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
bc1999f8
Commit
bc1999f8
authored
Nov 11, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replay_gain: use GLib instead of utils.h/log.h
Eliminated deprecated libraries.
parent
8a40e0b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
replay_gain.c
src/replay_gain.c
+11
-14
No files found.
src/replay_gain.c
View file @
bc1999f8
...
...
@@ -18,9 +18,6 @@
*/
#include "replay_gain.h"
#include "utils.h"
#include "log.h"
#include "conf.h"
#include "audio_format.h"
#include "pcm_utils.h"
...
...
@@ -49,8 +46,8 @@ void replay_gain_global_init(void)
}
else
if
(
strcmp
(
param
->
value
,
"album"
)
==
0
)
{
replay_gain_mode
=
REPLAY_GAIN_ALBUM
;
}
else
{
FATAL
(
"replaygain value
\"
%s
\"
at line %i is invalid
\n
"
,
param
->
value
,
param
->
line
);
g_error
(
"replaygain value
\"
%s
\"
at line %i is invalid
\n
"
,
param
->
value
,
param
->
line
);
}
param
=
getConfigParam
(
CONF_REPLAYGAIN_PREAMP
);
...
...
@@ -60,13 +57,13 @@ void replay_gain_global_init(void)
float
f
=
strtod
(
param
->
value
,
&
test
);
if
(
*
test
!=
'\0'
)
{
FATAL
(
"Replaygain preamp
\"
%s
\"
is not a number at "
"line %i
\n
"
,
param
->
value
,
param
->
line
);
g_error
(
"Replaygain preamp
\"
%s
\"
is not a number at "
"line %i
\n
"
,
param
->
value
,
param
->
line
);
}
if
(
f
<
-
15
||
f
>
15
)
{
FATAL
(
"Replaygain preamp
\"
%s
\"
is not between -15 and"
"15 at line %i
\n
"
,
param
->
value
,
param
->
line
);
g_error
(
"Replaygain preamp
\"
%s
\"
is not between -15 and"
"15 at line %i
\n
"
,
param
->
value
,
param
->
line
);
}
replay_gain_preamp
=
pow
(
10
,
f
/
20
.
0
);
...
...
@@ -92,7 +89,7 @@ static float calc_replay_gain_scale(float gain, float peak)
struct
replay_gain_info
*
replay_gain_info_new
(
void
)
{
struct
replay_gain_info
*
ret
=
xmalloc
(
sizeof
(
*
ret
)
);
struct
replay_gain_info
*
ret
=
g_new
(
struct
replay_gain_info
,
1
);
for
(
unsigned
i
=
0
;
i
<
G_N_ELEMENTS
(
ret
->
tuples
);
++
i
)
{
ret
->
tuples
[
i
].
gain
=
0
.
0
;
...
...
@@ -107,7 +104,7 @@ struct replay_gain_info *replay_gain_info_new(void)
void
replay_gain_info_free
(
struct
replay_gain_info
*
info
)
{
free
(
info
);
g_
free
(
info
);
}
void
...
...
@@ -121,9 +118,9 @@ replay_gain_apply(struct replay_gain_info *info, char *buffer, int size,
const
struct
replay_gain_tuple
*
tuple
=
&
info
->
tuples
[
replay_gain_mode
];
DEBUG
(
"computing ReplayGain %s scale with gain %f, peak %f
\n
"
,
replay_gain_mode_names
[
replay_gain_mode
],
tuple
->
gain
,
tuple
->
peak
);
g_debug
(
"computing ReplayGain %s scale with gain %f, peak %f
\n
"
,
replay_gain_mode_names
[
replay_gain_mode
],
tuple
->
gain
,
tuple
->
peak
);
info
->
scale
=
calc_replay_gain_scale
(
tuple
->
gain
,
tuple
->
peak
);
}
...
...
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