aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderAPI.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-05 02:05:50 +0100
committerMax Kellermann <max@duempel.org>2013-01-05 02:40:29 +0100
commit46ed91b53d4ee6df3f9b98bcfb4e36a97420b885 (patch)
tree2b1bfed19c42545822dcc524edaaadf11c1fc94f /src/DecoderAPI.cxx
parent73f6fc428a2d9b58564f0dabdbc59080a731ed5c (diff)
downloadmpd-46ed91b53d4ee6df3f9b98bcfb4e36a97420b885.tar.gz
mpd-46ed91b53d4ee6df3f9b98bcfb4e36a97420b885.tar.xz
mpd-46ed91b53d4ee6df3f9b98bcfb4e36a97420b885.zip
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.
Diffstat (limited to '')
-rw-r--r--src/DecoderAPI.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx
index 9ea222005..c703faa6c 100644
--- a/src/DecoderAPI.cxx
+++ b/src/DecoderAPI.cxx
@@ -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) {
- return_db = 20.0 * log10f(
+ decoder->dc->replay_gain_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);
}