taglib/taglib-1.5-1.6-ogg.patch
Michael Schwendt f69b1b0917 - Cherry-pick bug-fix patches from 1.6 development (also replaces the old
taglib-1.5-kde#161721.patch):
169810)
107659)
Fixed overflow while calculating bitrate of FLAC files with a very high
    bitrate.
:year() now falls back to YEAR if DATE doesn't exist and
    XiphComment::year() falls back to TRACKNUM if TRACKNUMBER doesn't
    exist. (BUG:144396)
:split().
:operator[] and in String::operator+=. (BUG:169389)
176373)
167786)
188578)
168382)
172556)
Added support for PRIV ID3v2 frames.
Empty ID3v2 genres are no longer treated as numeric ID3v1 genres.
Added support for the POPM (rating/playcount) ID3v2 frame.
161721)
2009-08-22 10:44:21 +00:00

47 lines
1.3 KiB
Diff

diff -Nur taglib-1.5/taglib/ogg/xiphcomment.cpp taglib/taglib/ogg/xiphcomment.cpp
--- taglib-1.5/taglib/ogg/xiphcomment.cpp 2008-02-04 16:14:46.000000000 +0100
+++ taglib/taglib/ogg/xiphcomment.cpp 2009-07-11 15:17:06.000000000 +0200
@@ -103,16 +103,20 @@
TagLib::uint Ogg::XiphComment::year() const
{
- if(d->fieldListMap["DATE"].isEmpty())
- return 0;
- return d->fieldListMap["DATE"].front().toInt();
+ if(!d->fieldListMap["DATE"].isEmpty())
+ return d->fieldListMap["DATE"].front().toInt();
+ if(!d->fieldListMap["YEAR"].isEmpty())
+ return d->fieldListMap["YEAR"].front().toInt();
+ return 0;
}
TagLib::uint Ogg::XiphComment::track() const
{
- if(d->fieldListMap["TRACKNUMBER"].isEmpty())
- return 0;
- return d->fieldListMap["TRACKNUMBER"].front().toInt();
+ if(!d->fieldListMap["TRACKNUMBER"].isEmpty())
+ return d->fieldListMap["TRACKNUMBER"].front().toInt();
+ if(!d->fieldListMap["TRACKNUM"].isEmpty())
+ return d->fieldListMap["TRACKNUM"].front().toInt();
+ return 0;
}
void Ogg::XiphComment::setTitle(const String &s)
@@ -142,6 +146,7 @@
void Ogg::XiphComment::setYear(uint i)
{
+ removeField("YEAR");
if(i == 0)
removeField("DATE");
else
@@ -150,6 +155,7 @@
void Ogg::XiphComment::setTrack(uint i)
{
+ removeField("TRACKNUM");
if(i == 0)
removeField("TRACKNUMBER");
else