diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp index e39f856f..ff7591c2 100644 --- a/taglib/asf/asffile.cpp +++ b/taglib/asf/asffile.cpp @@ -69,6 +69,8 @@ static ByteVector extendedContentDescriptionGuid("\x40\xA4\xD0\xD2\x07\xE3\xD2\x static ByteVector headerExtensionGuid("\xb5\x03\xbf_.\xa9\xcf\x11\x8e\xe3\x00\xc0\x0c Se", 16); static ByteVector metadataGuid("\xEA\xCB\xF8\xC5\xAF[wH\204g\xAA\214D\xFAL\xCA", 16); static ByteVector metadataLibraryGuid("\224\034#D\230\224\321I\241A\x1d\x13NEpT", 16); +static ByteVector contentEncryptionGuid("\x22\x11\xB3\xFB\xBD\x23\x11\xD2\xB4\xB7\x00\xA0\xC9\x55\xFC\x6E"); +static ByteVector extendedContentEncryptionGuid("\x29\x8A\xE6\x14\x26\x22\x4C\x17\xB9\x35\xDA\xE0\x7E\xE9\x28\x9C"); class ASF::File::BaseObject { @@ -337,6 +339,9 @@ void ASF::File::HeaderExtensionObject::parse(ASF::File *file, uint /*size*/) obj = new MetadataLibraryObject(); } else { + if(guid == contentEncryptionGuid || guid == extendedContentEncryptionGuid) { + file->d->properties->setEncrypted(true); + } obj = new UnknownObject(guid); } obj->parse(file, size); diff --git a/taglib/asf/asfproperties.cpp b/taglib/asf/asfproperties.cpp index 02d2d942..6597de13 100644 --- a/taglib/asf/asfproperties.cpp +++ b/taglib/asf/asfproperties.cpp @@ -38,11 +38,12 @@ using namespace TagLib; class ASF::Properties::PropertiesPrivate { public: - PropertiesPrivate(): length(0), bitrate(0), sampleRate(0), channels(0) {} + PropertiesPrivate(): length(0), bitrate(0), sampleRate(0), channels(0), encrypted(false) {} int length; int bitrate; int sampleRate; int channels; + bool encrypted; }; //////////////////////////////////////////////////////////////////////////////// @@ -80,6 +81,11 @@ int ASF::Properties::channels() const return d->channels; } +bool ASF::Properties::isEncrypted() const +{ + return d->encrypted; +} + //////////////////////////////////////////////////////////////////////////////// // private members //////////////////////////////////////////////////////////////////////////////// @@ -104,4 +110,9 @@ void ASF::Properties::setChannels(int length) d->channels = length; } +void ASF::Properties::setEncrypted(bool encrypted) +{ + d->encrypted = encrypted; +} + #endif diff --git a/taglib/asf/asfproperties.h b/taglib/asf/asfproperties.h index 290eac77..ca7b581d 100644 --- a/taglib/asf/asfproperties.h +++ b/taglib/asf/asfproperties.h @@ -54,12 +54,14 @@ namespace TagLib { virtual int bitrate() const; virtual int sampleRate() const; virtual int channels() const; + bool isEncrypted() const; #ifndef DO_NOT_DOCUMENT void setLength(int value); void setBitrate(int value); void setSampleRate(int value); void setChannels(int value); + void setEncrypted(bool value); #endif private: