Thanks for the answers so far. We immediately removed the 'isProtected' from ID3v2 usage since indeed this does not indicate DRM protection. <div><br></div><div>Further, I investigated a little bit how to detect DRM protection on specific files, and indeed, it seems you need to research the file contents itself, so patching tagLib is unavoidable. As far as I can see, it is only needed for WMA and MP4 files. </div>
<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>MP3 DRM protection:</div><div>Indeed: Non-existant. Sorry about the confusion.</div><div><br></div><div>MP4 DRM protection:</div>
<div>Something with a 'drms' atom should be detected, if it's present, the file is DRM protected. But I can not find proper documentation on the MP4 fileformats to know where to find this atom (I know it should be in the 'moov' atom, but then the info I found stops...)</div>
</div><div><br></div><div>WMA DRM protection:</div><div><br></div><div>In TagLib's asffile.cpp you could add to the list of ByteVector's at the near-top of the file:</div><div>static ByteVector asfContentEncryptionGuid("\x22\x11\xB3\xFB\xBD\x23\x11\xD2\xB4\xB7\x00\xA0\xC9\x55\xFC\x6E");</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><meta http-equiv="content-type" content="text/html; charset=utf-8">static ByteVector asfExtendedContentEncryptionGuid("\x29\x8A\xE6\x14\x26\x22\x4C\x17\xB9\x35\xDA\xE0\x7E\xE9\x28\x9C");</div>
<div><br></div><div>Then in ASF::File::read():</div><div>Change:</div><div><div>else {</div><div> obj = new UnknownObject(guid);</div><div>}</div></div><div>To:</div><div><div>else {</div><div> if (guid == contentEncryptionGuid || guid == extendedContentEncryptionGuid) {</div>
<div> d->tag->setDRMProtected(true);</div><div> }</div><div> obj = new UnknownObject(guid);</div><div>}</div></div><div><br></div><div>Then in asftag.cpp / asftag.h add these 2 functions:</div><div><div><div>void ASF::Tag::setDRMProtected(bool value)</div>
<div>{</div><div> setAttribute("WM/DRMProtected", value);</div><div>}</div></div></div><div><div>bool ASF::Tag::isDRMProtected() const</div><div>{</div><div> if(d->attributeListMap.contains("WM/DRMProtected"))</div>
<div> return d->attributeListMap["WM/DRMProtected"][0].toBool();</div><div> return false;</div><div>}</div></div><div><br></div><div>2011/3/29 Lukáš Lalinský <span dir="ltr"><<a href="mailto:lalinsky@gmail.com">lalinsky@gmail.com</a>></span></div>
<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Tue, Mar 29, 2011 at 11:15 AM, Martijn van Rheenen <<a href="mailto:rheenen@gmail.com">rheenen@gmail.com</a>> wrote:<br>
> Now, to the real question: I want to be able to detect whether a file is DRM<br>
> protected. So, not only MP3, but also WMA, MP4-based files etc. Is there a<br>
> proven method to find this in a most generic and fast way for a file? Or do<br>
> I have to resort back to file-type-specific code like I had to do for Album<br>
> Art? Note that I just want a 'bool isDRMProtected()' method for this,<br>
> nothing more.<br>
<br>
</div>I think you will have to do some research on this, because TagLib<br>
doesn't currently expose this kind of information. I wasn't even aware<br>
that MP3 files can be DRM-protected. For WMA and MP4 it should be<br>
possible to implement the checks in TagLib, as it has to read the<br>
internal structures anyway, but I'm afraid that you can't do that<br>
without patching TagLib. I'm willing to write the necessary code this,<br>
but I'd need a pointer where to look for the bits and some examples of<br>
DRM-protected files (I don't have any).<br>
<div class="im"><br>
> I already noticed the ID3v2 has a 'isProtected()' method, but don't know<br>
> whether that means 'DRM protected' or not...<br>
<br>
</div>No, it means CRC checksum protection.<br>
<br>
Lukas<br>
_______________________________________________<br>
taglib-devel mailing list<br>
<a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
</blockquote></div><br></div>