[FFmpeg-devel] [PATCH] Google WebP support

Michael Niedermayer michaelni
Sun Oct 17 21:20:47 CEST 2010


On Sun, Oct 17, 2010 at 11:31:29AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Oct 17, 2010 at 11:29 AM, Peter Ross <pross at xvid.org> wrote:
> > On Sun, Oct 17, 2010 at 07:03:59AM -0700, Pascal Massimino wrote:
> > +static int probe(AVProbeData *p)
> > +{
> > + ? ?if (!memcmp(p->buf, "RIFF", 4) && !memcmp(p->buf + 8, "WEBP", 4))
> > + ? ? ? ?return AVPROBE_SCORE_MAX;
> > +
> > + ? ?return 0;
> > +}
> > +
> > +static int read_header(AVFormatContext *s, AVFormatParameters *ap)
> > +{
> > + ? ?AVStream *st;
> > + ? ?uint32_t riff_size;
> > +
> > + ? ?if (get_le32(s->pb) != AV_RL32("RIFF"))
> > + ? ? ? ?return AVERROR(EINVAL);
> > + ? ?riff_size = get_le32(s->pb);
> > + ? ?if (get_le32(s->pb) != AV_RL32("WEBP"))
> > + ? ? ? ?return AVERROR(EINVAL);
> >
> > There is no need to check the RIFF/WEBP magic numbers twice.
> 
> Applications might not use the probing.

No but if an application chooses to use the webp demuxer without checking that
it is webp, that is the applications problem. It might even intentionally
override probe for whatever reasons.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101017/0067f7d2/attachment.pgp>



More information about the ffmpeg-devel mailing list