From 6c910bdfbc38f40573ea3f6697abb190ca8441f8 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 8 Jan 2022 01:29:55 -0800 Subject: [PATCH] TagLib: Fix reading ReplayGain tags from ID3v2 tags --- Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp index 7f0d01b28..c6b936ecc 100644 --- a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp @@ -252,7 +252,13 @@ float ID3v2::Tag::rg(const String &type) const for (FrameList::ConstIterator it = list.begin(); it != list.end(); ++it) { UserTextIdentificationFrame const* frame = static_cast(*it); if (!frame->description().isNull() && frame->description() == type) { - return frame->toString().toFloat(); + // Remove description + StringList l = frame->fieldList(); + for(StringList::Iterator it = l.begin(); it != l.end(); ++it) { + l.erase(it); + break; + } + return l.toString().toFloat(); } } }