tag/ApeReplayGain, decoder/mad: move duplicate code to tag/ReplayGain.cxx

This commit is contained in:
Max Kellermann
2014-09-24 20:10:59 +02:00
parent 9270485723
commit 05dd9acba8
5 changed files with 83 additions and 27 deletions

View File

@@ -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);