From 05dd9acba8c7534c8e8f01bf15342ab7493d28fc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Sep 2014 20:10:59 +0200 Subject: tag/ApeReplayGain, decoder/mad: move duplicate code to tag/ReplayGain.cxx --- src/decoder/plugins/MadDecoderPlugin.cxx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/decoder/plugins') 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); -- cgit v1.2.3