Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/taglib-1.9.1/taglib/mp4/mp4atom.cpp b/taglib-1.9.1/taglib/mp4/mp4atom.cpp
- index 7b87a4796d..2ae5c386c7 100644
- --- a/taglib-1.9.1/taglib/mp4/mp4atom.cpp
- +++ b/taglib-1.9.1/taglib/mp4/mp4atom.cpp
- @@ -29,10 +29,10 @@
- using namespace TagLib;
- -const char *MP4::Atom::containers[11] = {
- +const char *MP4::Atom::containers[12] = {
- "moov", "udta", "mdia", "meta", "ilst",
- "stbl", "minf", "moof", "traf", "trak",
- - "stsd"
- + "stsd", "Xtra"
- };
- MP4::Atom::Atom(File *file)
- diff --git a/taglib-1.9.1/taglib/mp4/mp4atom.h b/taglib-1.9.1/taglib/mp4/mp4atom.h
- index ea5091a8b4..1eaf23ca4a 100644
- --- a/taglib-1.9.1/taglib/mp4/mp4atom.h
- +++ b/taglib-1.9.1/taglib/mp4/mp4atom.h
- @@ -87,8 +87,8 @@ namespace TagLib {
- TagLib::ByteVector name;
- AtomList children;
- private:
- - static const int numContainers = 11;
- - static const char *containers[11];
- + static const int numContainers = 12;
- + static const char *containers[12];
- };
- //! Root-level atoms
- diff --git a/taglib-1.9.1/taglib/mp4/mp4tag.cpp b/taglib-1.9.1/taglib/mp4/mp4tag.cpp
- index bbe3301d97..29f205353d 100644
- --- a/taglib-1.9.1/taglib/mp4/mp4tag.cpp
- +++ b/taglib-1.9.1/taglib/mp4/mp4tag.cpp
- @@ -95,6 +95,35 @@ MP4::Tag::Tag(TagLib::File *file, MP4::Atoms *atoms)
- parseText(atom, file);
- }
- }
- +
- + MP4::Atom *xtra = atoms->find("moov", "udta", "Xtra");
- + if(!xtra) {
- + //debug("Atom moov.udta.Xtra not found.");
- + return;
- + }
- + else {
- + for(unsigned int i = 0; i < xtra->children.size(); i++) {
- + MP4::Atom *atom = xtra->children[i];
- + file->seek(atom->offset + 8);
- + ByteVector data = file->readBlock(atom->length - 8);
- + String name = String(data.data(), String::UTF8);
- + if(name == "WM/InitialKey") {
- + unsigned int pos = name.size();
- + const unsigned int length = static_cast<unsigned int>(data.mid(pos, 4).toUInt());
- + pos += 4;
- + for(unsigned int item = 0; item < length; ++item) {
- + // 4 bytes for block length
- + pos += 4;
- + // another 2 bytes for encoding
- + pos += 2;
- + StringList valueList;
- + String value = String(data.mid(pos), String::UTF16LE);
- + valueList.append(value);
- + addItem(String("WM/InitialKey"), valueList);
- + }
- + }
- + }
- + }
- }
- MP4::Tag::~Tag()
Advertisement
Add Comment
Please, Sign In to add comment