[FFmpeg-devel] [PATCH] Detect Windows Media DRM protected files and display warning

Daniel G. Taylor dan
Sun Oct 11 12:55:22 CEST 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: detect_wmdrm.diff
Type: text/x-patch
Size: 2448 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091011/ca0db303/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091011/ca0db303/attachment.pgp>



More information about the ffmpeg-devel mailing list