diff options
author | Max Kellermann <max@musicpd.org> | 2018-10-21 19:32:45 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-10-22 09:44:50 +0200 |
commit | a491d8ae24a2640becf16df41ff8046ffa43d6a5 (patch) | |
tree | cfdbdab808b8231dfc63027308fed6b9e0836fbf /src/decoder | |
parent | 3cd5dd15f8a8383d51dedf19a207ebb8171dd26a (diff) |
decoder/mad: use class UniqueId3Tag
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/plugins/MadDecoderPlugin.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 3a35df141..e6ff445d4 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -36,6 +36,7 @@ #include <mad.h> #ifdef ENABLE_ID3TAG +#include "tag/Id3Unique.hxx" #include <id3tag.h> #endif @@ -310,12 +311,12 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag) id3_data = allocated.get(); } - struct id3_tag *const id3_tag = id3_tag_parse(id3_data, tagsize); + const UniqueId3Tag id3_tag(id3_tag_parse(id3_data, tagsize)); if (id3_tag == nullptr) return; if (mpd_tag) { - auto tmp_tag = tag_id3_import(id3_tag); + auto tmp_tag = tag_id3_import(id3_tag.get()); if (tmp_tag != nullptr) { delete *mpd_tag; *mpd_tag = tmp_tag.release(); @@ -325,16 +326,14 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag) if (client != nullptr) { ReplayGainInfo rgi; - if (Id3ToReplayGainInfo(rgi, id3_tag)) { + if (Id3ToReplayGainInfo(rgi, id3_tag.get())) { client->SubmitReplayGain(&rgi); found_replay_gain = true; } - client->SubmitMixRamp(parse_id3_mixramp(id3_tag)); + client->SubmitMixRamp(parse_id3_mixramp(id3_tag.get())); } - id3_tag_delete(id3_tag); - #else /* !ENABLE_ID3TAG */ (void)mpd_tag; |