aboutsummaryrefslogtreecommitdiffstats
path: root/taglib/asf
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2015-04-28 16:40:24 +0900
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2015-04-28 16:40:24 +0900
commit8d708c03e1a75a5ac032a10a2e29ea3f77f53c97 (patch)
tree4397ddee352bab4733d6bfb5d40254f1130253a7 /taglib/asf
parentf9a0b5083054265821a06821af9d656e8e53a0a2 (diff)
Store any GUID fields in Metadata Library Object.
Diffstat (limited to 'taglib/asf')
-rw-r--r--taglib/asf/asffile.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp
index f3a9e47f..452b28fe 100644
--- a/taglib/asf/asffile.cpp
+++ b/taglib/asf/asffile.cpp
@@ -69,19 +69,6 @@ namespace
static const ByteVector contentEncryptionGuid("\xFB\xB3\x11\x22\x23\xBD\xD2\x11\xB4\xB7\x00\xA0\xC9\x55\xFC\x6E", 16);
static const ByteVector extendedContentEncryptionGuid("\x14\xE6\x8A\x29\x22\x26 \x17\x4C\xB9\x35\xDA\xE0\x7E\xE9\x28\x9C", 16);
static const ByteVector advancedContentEncryptionGuid("\xB6\x9B\x07\x7A\xA4\xDA\x12\x4E\xA5\xCA\x91\xD3\x8D\xC1\x1A\x8D", 16);
-
- // Some known IDs should belong to MetadataLibraryObject.
- // https://msdn.microsoft.com/en-us/library/windows/desktop/dd743066(v=vs.85).aspx
-
- static const size_t MetadataLibraryObjectIDsSize = 5;
- static const wchar_t *MetadataLibraryObjectIDs[] =
- {
- L"WM/MediaClassPrimaryID",
- L"WM/MediaClassSecondaryID",
- L"WM/WMCollectionGroupID",
- L"WM/WMCollectionID",
- L"WM/WMContentID"
- };
}
class ASF::File::BaseObject
@@ -547,24 +534,17 @@ bool ASF::File::save()
bool inExtendedContentDescriptionObject = false;
bool inMetadataObject = false;
- bool inMetadataLibraryObject = false;
- for(size_t i = 0; i < MetadataLibraryObjectIDsSize; ++i) {
- if(name == MetadataLibraryObjectIDs[i]) {
- inMetadataLibraryObject = true;
- break;
- }
- }
-
for(unsigned int j = 0; j < attributes.size(); j++) {
const Attribute &attribute = attributes[j];
- bool largeValue = attribute.dataSize() > 65535;
+ const bool largeValue = (attribute.dataSize() > 65535);
+ const bool guid = (attribute.type() == Attribute::GuidType);
- if(!inExtendedContentDescriptionObject && !inMetadataLibraryObject && !largeValue && attribute.language() == 0 && attribute.stream() == 0) {
+ if(!inExtendedContentDescriptionObject && !guid && !largeValue && attribute.language() == 0 && attribute.stream() == 0) {
d->extendedContentDescriptionObject->attributeData.append(attribute.render(name));
inExtendedContentDescriptionObject = true;
}
- else if(!inMetadataObject && !inMetadataLibraryObject && !largeValue && attribute.language() == 0 && attribute.stream() != 0) {
+ else if(!inMetadataObject && !guid && !largeValue && attribute.language() == 0 && attribute.stream() != 0) {
d->metadataObject->attributeData.append(attribute.render(name, 1));
inMetadataObject = true;
}