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/decoder/plugins/MadDecoderPlugin.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 '')
-rw-r--r-- | src/decoder/plugins/MadDecoderPlugin.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 8c9707b89..3cbc448f7 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -25,6 +25,7 @@ #include "tag/TagId3.hxx" #include "tag/TagRva2.hxx" #include "tag/TagHandler.hxx" +#include "tag/ReplayGain.hxx" #include "CheckAudioFormat.hxx" #include "util/StringUtil.hxx" #include "util/ASCII.hxx" @@ -270,19 +271,8 @@ parse_id3_replay_gain_info(ReplayGainInfo &rgi, id3_ucs4_latin1duplicate(id3_field_getstring (&frame->fields[2])); - if (StringEqualsCaseASCII(key, "replaygain_track_gain")) { - rgi.tuples[REPLAY_GAIN_TRACK].gain = atof(value); + if (ParseReplayGainTag(rgi, key, value)) found = true; - } else if (StringEqualsCaseASCII(key, "replaygain_album_gain")) { - rgi.tuples[REPLAY_GAIN_ALBUM].gain = atof(value); - found = true; - } else if (StringEqualsCaseASCII(key, "replaygain_track_peak")) { - rgi.tuples[REPLAY_GAIN_TRACK].peak = atof(value); - found = true; - } else if (StringEqualsCaseASCII(key, "replaygain_album_peak")) { - rgi.tuples[REPLAY_GAIN_ALBUM].peak = atof(value); - found = true; - } free(key); free(value); |