[FFmpeg-devel] [PATCH] Detect Windows Media DRM protected files and display warning
Michael Niedermayer
michaelni
Mon Oct 12 01:00:15 CEST 2009
On Sun, Oct 11, 2009 at 12:55:22PM +0200, Daniel G. Taylor wrote:
> On Sat, 2009-10-10 at 01:20 +0200, Michael Niedermayer wrote:
> > > asf.c | 12 ++++++++++++
> > > asf.h | 3 +++
> > > asfdec.c | 18 ++++++++++++++++++
> > > 3 files changed, 33 insertions(+)
> > > 50a00975357f4f584a53e03f8eb42190fdbda237 detect_wmdrm.diff
> > > Index: libavformat/asfdec.c
> > > ===================================================================
> > > --- libavformat/asfdec.c (revision 20192)
> > > +++ libavformat/asfdec.c (working copy)
> > > @@ -531,6 +531,24 @@
> > > #endif
> > > } else if (url_feof(pb)) {
> > > return -1;
> > > + } else if (!guidcmp(&g, &ff_asf_content_encryption)) {
> > > + if (!s->keylen) {
> > > + av_log(s, AV_LOG_WARNING, "DRM protected stream detected, "
> > > + "decoding will likely fail!\n");
> >
> > please dont split the string except at \n in the string
>
> Fixed.
>
> > > + }
> > > + url_fseek(pb, gsize - 24, SEEK_CUR);
> > > + } else if (!guidcmp(&g, &ff_asf_ext_content_encryption)) {
> > > + if (!s->keylen) {
> > > + av_log(s, AV_LOG_WARNING, "Ext DRM protected stream detected, "
> > > + "decoding will likely fail!\n");
> > > + }
> > > + url_fseek(pb, gsize - 24, SEEK_CUR);
> > > + } else if (!guidcmp(&g, &ff_asf_digital_signature)) {
> > > + if (!s->keylen) {
> > > + av_log(s, AV_LOG_WARNING, "Digital signature detected, "
> > > + "decoding will likely fail!\n");
> > > + }
> > > + url_fseek(pb, gsize - 24, SEEK_CUR);
> > > } else {
> > > url_fseek(pb, gsize - 24, SEEK_CUR);
> > > }
> >
> > theres quite a bit of factorizeable code in there
>
> Fixed. Patch is now smaller and duplication is removed.
> --
> Daniel G. Taylor
> http://programmer-art.org
> asf.c | 12 ++++++++++++
> asf.h | 3 +++
> asfdec.c | 9 +++++++++
> 3 files changed, 24 insertions(+)
> 888237446b5b97fceea69af879e3bd812acf2614 detect_wmdrm.diff
looks ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091012/bc5d8b2d/attachment.pgp>
More information about the ffmpeg-devel
mailing list