- Update with four post-1.6.1 fixes from 20100126 (r1056922, r1062026,

r1062426, r1078611).
This commit is contained in:
Michael Schwendt 2010-01-26 20:37:10 +00:00
parent 2f54472d3a
commit 4ff6ac8e82
2 changed files with 108 additions and 1 deletions

101
taglib-1.6.1-20100126.patch Normal file
View File

@ -0,0 +1,101 @@
--- taglib-1.6.1/taglib/asf/asftag.cpp 2009-09-08 09:26:12.000000000 +0200
+++ taglib-20100126/taglib/asf/asftag.cpp 2009-12-13 19:12:03.000000000 +0100
@@ -105,8 +105,13 @@
unsigned int
ASF::Tag::track() const
{
- if(d->attributeListMap.contains("WM/TrackNumber"))
- return d->attributeListMap["WM/TrackNumber"][0].toString().toInt();
+ if(d->attributeListMap.contains("WM/TrackNumber")) {
+ const ASF::Attribute attr = d->attributeListMap["WM/TrackNumber"][0];
+ if(attr.type() == ASF::Attribute::DWordType)
+ return attr.toUInt();
+ else
+ return attr.toString().toInt();
+ }
if(d->attributeListMap.contains("WM/Track"))
return d->attributeListMap["WM/Track"][0].toUInt();
return 0;
--- taglib-1.6.1/taglib/mpeg/id3v2/id3v2synchdata.cpp 2008-02-06 06:00:24.000000000 +0100
+++ taglib-20100126/taglib/mpeg/id3v2/id3v2synchdata.cpp 2009-12-01 19:12:04.000000000 +0100
@@ -33,10 +33,28 @@
TagLib::uint SynchData::toUInt(const ByteVector &data)
{
uint sum = 0;
+ bool notSynchSafe = false;
int last = data.size() > 4 ? 3 : data.size() - 1;
- for(int i = 0; i <= last; i++)
+ for(int i = 0; i <= last; i++) {
+ if(data[i] & 0x80) {
+ notSynchSafe = true;
+ break;
+ }
+
sum |= (data[i] & 0x7f) << ((last - i) * 7);
+ }
+
+ if(notSynchSafe) {
+ /*
+ * Invalid data; assume this was created by some buggy software that just
+ * put normal integers here rather than syncsafe ones, and try it that
+ * way.
+ */
+ sum = 0;
+ for(int i = 0; i <= last; i++)
+ sum |= data[i] << ((last - i) * 8);
+ }
return sum;
}
--- taglib-1.6.1/taglib/mp4/mp4file.cpp 2009-10-31 09:59:40.000000000 +0100
+++ taglib-20100126/taglib/mp4/mp4file.cpp 2009-12-15 19:12:03.000000000 +0100
@@ -113,6 +113,13 @@
return;
}
+ // must have a moov atom, otherwise consider it invalid
+ MP4::Atom *moov = d->atoms->find("moov");
+ if(!moov) {
+ setValid(false);
+ return;
+ }
+
d->tag = new Tag(this, d->atoms);
if(readProperties) {
d->properties = new Properties(this, d->atoms, audioPropertiesStyle);
--- taglib-1.6.1/taglib/mp4/mp4tag.cpp 2009-10-29 16:53:20.000000000 +0100
+++ taglib-20100126/taglib/mp4/mp4tag.cpp 2010-01-24 19:12:02.000000000 +0100
@@ -42,12 +42,12 @@
public:
TagPrivate() : file(0), atoms(0) {}
~TagPrivate() {}
- File *file;
+ TagLib::File *file;
Atoms *atoms;
ItemListMap items;
};
-MP4::Tag::Tag(File *file, MP4::Atoms *atoms)
+MP4::Tag::Tag(TagLib::File *file, MP4::Atoms *atoms)
{
d = new TagPrivate;
d->file = file;
@@ -270,7 +270,7 @@
ByteVector::fromShort(item.toIntPair().first) +
ByteVector::fromShort(item.toIntPair().second) +
ByteVector(2, '\0'));
- return renderData(name, 0x15, data);
+ return renderData(name, 0x00, data);
}
ByteVector
@@ -280,7 +280,7 @@
data.append(ByteVector(2, '\0') +
ByteVector::fromShort(item.toIntPair().first) +
ByteVector::fromShort(item.toIntPair().second));
- return renderData(name, 0x15, data);
+ return renderData(name, 0x00, data);
}
ByteVector

View File

@ -12,7 +12,7 @@
Name: taglib
Version: 1.6.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Audio Meta-Data Library
Group: System Environment/Libraries
@ -31,6 +31,7 @@ Patch1: taglib-1.5b1-multilib.patch
Patch2: taglib-1.5rc1-multilib.patch
Patch3: taglib-1.6.1-20091103.patch
Patch4: taglib-1.6.1-20100126.patch
BuildRequires: cmake
BuildRequires: pkgconfig
@ -85,6 +86,7 @@ Files needed when building software with %{name}.
%patch2 -p1 -b .multilib
%patch3 -p1 -b .20091103
%patch4 -p1 -b .20100126
%build
@ -157,6 +159,10 @@ rm -rf %{buildroot}
%changelog
* Tue Jan 26 2010 Michael Schwendt <mschwendt@fedoraproject.org> - 1.6.1-3
- Update with four post-1.6.1 fixes from 20100126
(r1056922, r1062026, r1062426, r1078611).
* Fri Nov 6 2009 Michael Schwendt <mschwendt@fedoraproject.org> - 1.6.1-2
- Update with two post-1.6.1 changes from 20091103.