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
46ed91b5
Commit
46ed91b5
authored
Jan 05, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderAPI: _replay_gain() returns void
Let the function decoder_replay_gain() update decoder_control::replay_gain_db instead of letting each decoder plugin take care for that.
parent
73f6fc42
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
28 deletions
+12
-28
DecoderAPI.cxx
src/DecoderAPI.cxx
+3
-7
FLACCommon.cxx
src/decoder/FLACCommon.cxx
+2
-3
mad_decoder_plugin.c
src/decoder/mad_decoder_plugin.c
+2
-3
decoder_api.h
src/decoder_api.h
+2
-4
dump_playlist.cxx
test/dump_playlist.cxx
+1
-4
read_tags.c
test/read_tags.c
+1
-3
run_decoder.c
test/run_decoder.c
+1
-4
No files found.
src/DecoderAPI.cxx
View file @
46ed91b5
...
...
@@ -519,11 +519,10 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
return
cmd
;
}
float
void
decoder_replay_gain
(
struct
decoder
*
decoder
,
const
struct
replay_gain_info
*
replay_gain_info
)
{
float
return_db
=
0
;
assert
(
decoder
!=
NULL
);
if
(
replay_gain_info
!=
NULL
)
{
...
...
@@ -532,7 +531,7 @@ decoder_replay_gain(struct decoder *decoder,
serial
=
1
;
if
(
REPLAY_GAIN_OFF
!=
replay_gain_mode
)
{
retur
n_db
=
20.0
*
log10f
(
decoder
->
dc
->
replay_gai
n_db
=
20.0
*
log10f
(
replay_gain_tuple_scale
(
&
replay_gain_info
->
tuples
[
replay_gain_get_real_mode
()],
replay_gain_preamp
,
replay_gain_missing_preamp
,
...
...
@@ -551,19 +550,16 @@ decoder_replay_gain(struct decoder *decoder,
}
}
else
decoder
->
replay_gain_serial
=
0
;
return
return_db
;
}
void
decoder_mixramp
(
struct
decoder
*
decoder
,
float
replay_gain_db
,
decoder_mixramp
(
struct
decoder
*
decoder
,
char
*
mixramp_start
,
char
*
mixramp_end
)
{
assert
(
decoder
!=
NULL
);
struct
decoder_control
*
dc
=
decoder
->
dc
;
assert
(
dc
!=
NULL
);
dc
->
replay_gain_db
=
replay_gain_db
;
dc_mixramp_start
(
dc
,
mixramp_start
);
dc_mixramp_end
(
dc
,
mixramp_end
);
}
src/decoder/FLACCommon.cxx
View file @
46ed91b5
...
...
@@ -109,7 +109,6 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
struct
replay_gain_info
rgi
;
char
*
mixramp_start
;
char
*
mixramp_end
;
float
replay_gain_db
=
0
;
switch
(
block
->
type
)
{
case
FLAC__METADATA_TYPE_STREAMINFO
:
...
...
@@ -118,10 +117,10 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
case
FLAC__METADATA_TYPE_VORBIS_COMMENT
:
if
(
flac_parse_replay_gain
(
&
rgi
,
block
))
replay_gain_db
=
decoder_replay_gain
(
data
->
decoder
,
&
rgi
);
decoder_replay_gain
(
data
->
decoder
,
&
rgi
);
if
(
flac_parse_mixramp
(
&
mixramp_start
,
&
mixramp_end
,
block
))
decoder_mixramp
(
data
->
decoder
,
replay_gain_db
,
decoder_mixramp
(
data
->
decoder
,
mixramp_start
,
mixramp_end
);
if
(
data
->
tag
!=
nullptr
)
...
...
src/decoder/mad_decoder_plugin.c
View file @
46ed91b5
...
...
@@ -359,15 +359,14 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize,
struct
replay_gain_info
rgi
;
char
*
mixramp_start
;
char
*
mixramp_end
;
float
replay_gain_db
=
0
;
if
(
parse_id3_replay_gain_info
(
&
rgi
,
id3_tag
))
{
replay_gain_db
=
decoder_replay_gain
(
data
->
decoder
,
&
rgi
);
decoder_replay_gain
(
data
->
decoder
,
&
rgi
);
data
->
found_replay_gain
=
true
;
}
if
(
parse_id3_mixramp
(
&
mixramp_start
,
&
mixramp_end
,
id3_tag
))
decoder_mixramp
(
data
->
decoder
,
replay_gain_db
,
decoder_mixramp
(
data
->
decoder
,
mixramp_start
,
mixramp_end
);
}
...
...
src/decoder_api.h
View file @
46ed91b5
...
...
@@ -152,9 +152,8 @@ decoder_tag(struct decoder *decoder, struct input_stream *is,
* @param decoder the decoder object
* @param rgi the replay_gain_info object; may be NULL to invalidate
* the previous replay gain values
* @return the replay gain adjustment used
*/
float
void
decoder_replay_gain
(
struct
decoder
*
decoder
,
const
struct
replay_gain_info
*
replay_gain_info
);
...
...
@@ -162,12 +161,11 @@ decoder_replay_gain(struct decoder *decoder,
* Store MixRamp tags.
*
* @param decoder the decoder object
* @param replay_gain_db the ReplayGain adjustment used for this song
* @param mixramp_start the mixramp_start tag; may be NULL to invalidate
* @param mixramp_end the mixramp_end tag; may be NULL to invalidate
*/
void
decoder_mixramp
(
struct
decoder
*
decoder
,
float
replay_gain_db
,
decoder_mixramp
(
struct
decoder
*
decoder
,
char
*
mixramp_start
,
char
*
mixramp_end
);
#endif
test/dump_playlist.cxx
View file @
46ed91b5
...
...
@@ -113,7 +113,7 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder,
return
DECODE_COMMAND_NONE
;
}
float
void
decoder_replay_gain
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
const
struct
replay_gain_info
*
replay_gain_info
)
{
...
...
@@ -127,13 +127,10 @@ decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
if
(
replay_gain_tuple_defined
(
tuple
))
g_printerr
(
"replay_gain[track]: gain=%f peak=%f
\n
"
,
tuple
->
gain
,
tuple
->
peak
);
return
0.0
;
}
void
decoder_mixramp
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
float
replay_gain_db
,
char
*
mixramp_start
,
char
*
mixramp_end
)
{
g_free
(
mixramp_start
);
...
...
test/read_tags.c
View file @
46ed91b5
...
...
@@ -118,16 +118,14 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder,
return
DECODE_COMMAND_NONE
;
}
float
void
decoder_replay_gain
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
const
struct
replay_gain_info
*
replay_gain_info
)
{
return
0
.
0
;
}
void
decoder_mixramp
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
float
replay_gain_db
,
char
*
mixramp_start
,
char
*
mixramp_end
)
{
g_free
(
mixramp_start
);
...
...
test/run_decoder.c
View file @
46ed91b5
...
...
@@ -139,7 +139,7 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder,
return
DECODE_COMMAND_NONE
;
}
float
void
decoder_replay_gain
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
const
struct
replay_gain_info
*
replay_gain_info
)
{
...
...
@@ -153,13 +153,10 @@ decoder_replay_gain(G_GNUC_UNUSED struct decoder *decoder,
if
(
replay_gain_tuple_defined
(
tuple
))
g_printerr
(
"replay_gain[track]: gain=%f peak=%f
\n
"
,
tuple
->
gain
,
tuple
->
peak
);
return
0
.
0
;
}
void
decoder_mixramp
(
G_GNUC_UNUSED
struct
decoder
*
decoder
,
G_GNUC_UNUSED
float
replay_gain_db
,
char
*
mixramp_start
,
char
*
mixramp_end
)
{
g_free
(
mixramp_start
);
...
...
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