diff options
author | Max Kellermann <max@duempel.org> | 2014-09-24 20:10:59 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-09-24 21:50:34 +0200 |
commit | 05dd9acba8c7534c8e8f01bf15342ab7493d28fc (patch) | |
tree | eab583c0b671e0d405dc41cbccfdebc740cf3819 /src/tag/ApeReplayGain.cxx | |
parent | 92704857231423f662152495d5521301195dfd17 (diff) | |
download | mpd-05dd9acba8c7534c8e8f01bf15342ab7493d28fc.tar.gz mpd-05dd9acba8c7534c8e8f01bf15342ab7493d28fc.tar.xz mpd-05dd9acba8c7534c8e8f01bf15342ab7493d28fc.zip |
tag/ApeReplayGain, decoder/mad: move duplicate code to tag/ReplayGain.cxx
Diffstat (limited to 'src/tag/ApeReplayGain.cxx')
-rw-r--r-- | src/tag/ApeReplayGain.cxx | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/tag/ApeReplayGain.cxx b/src/tag/ApeReplayGain.cxx index 6afb3e96e..345f45710 100644 --- a/src/tag/ApeReplayGain.cxx +++ b/src/tag/ApeReplayGain.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "ApeReplayGain.hxx" #include "ApeLoader.hxx" -#include "ReplayGainInfo.hxx" +#include "ReplayGain.hxx" #include "util/ASCII.hxx" #include "fs/Path.hxx" @@ -43,20 +43,7 @@ replay_gain_ape_callback(unsigned long flags, const char *key, memcpy(value, _value, value_length); value[value_length] = 0; - if (StringEqualsCaseASCII(key, "replaygain_track_gain")) { - info.tuples[REPLAY_GAIN_TRACK].gain = atof(value); - return true; - } else if (StringEqualsCaseASCII(key, "replaygain_album_gain")) { - info.tuples[REPLAY_GAIN_ALBUM].gain = atof(value); - return true; - } else if (StringEqualsCaseASCII(key, "replaygain_track_peak")) { - info.tuples[REPLAY_GAIN_TRACK].peak = atof(value); - return true; - } else if (StringEqualsCaseASCII(key, "replaygain_album_peak")) { - info.tuples[REPLAY_GAIN_ALBUM].peak = atof(value); - return true; - } else - return false; + return ParseReplayGainTag(info, key, value); } bool |