aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderAPI.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-25 19:05:49 +0200
committerMax Kellermann <max@duempel.org>2013-10-25 19:12:46 +0200
commitd6e28c42e5c2bdab73d3553b21a09fa28dabd037 (patch)
tree6b7e43d0b777b3be149c86e853debef3cbd49826 /src/DecoderAPI.cxx
parent6d475c40de567d778fa6f96c379687a8bf83f82b (diff)
downloadmpd-d6e28c42e5c2bdab73d3553b21a09fa28dabd037.tar.gz
mpd-d6e28c42e5c2bdab73d3553b21a09fa28dabd037.tar.xz
mpd-d6e28c42e5c2bdab73d3553b21a09fa28dabd037.zip
ReplayGainInfo: refactor to a class
Diffstat (limited to 'src/DecoderAPI.cxx')
-rw-r--r--src/DecoderAPI.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx
index 4866c4bb8..f672b1750 100644
--- a/src/DecoderAPI.cxx
+++ b/src/DecoderAPI.cxx
@@ -518,11 +518,12 @@ decoder_replay_gain(Decoder &decoder,
if (rgm != REPLAY_GAIN_ALBUM)
rgm = REPLAY_GAIN_TRACK;
- decoder.dc.replay_gain_db = 20.0 * log10f(
- replay_gain_tuple_scale(
- &replay_gain_info->tuples[rgm],
- replay_gain_preamp, replay_gain_missing_preamp,
- replay_gain_limit));
+ const auto &tuple = replay_gain_info->tuples[rgm];
+ const auto scale =
+ tuple.CalculateScale(replay_gain_preamp,
+ replay_gain_missing_preamp,
+ replay_gain_limit);
+ decoder.dc.replay_gain_db = 20.0 * log10f(scale);
}
decoder.replay_gain_info = *replay_gain_info;