[FFmpeg-devel] [PATCH] DeluxePaint Animation playback system

Reimar Döffinger Reimar.Doeffinger
Fri Aug 28 16:31:51 CEST 2009


On Sat, Aug 29, 2009 at 12:16:25AM +1000, Peter Ross wrote:
> On Wed, Aug 26, 2009 at 02:15:06PM +0200, Reimar D?ffinger wrote:
> > On Wed, Aug 26, 2009 at 08:45:33PM +1000, Peter Ross wrote:
> 
> > > +#define LPF_TAG  MKTAG('L','P','F',' ')
> > > +#define ANIM_TAG MKTAG('A','N','I','M')
> > > +
> > > +static int probe(AVProbeData *p)
> > > +{
> > > +    /* verify tags and video dimensions */
> > > +    if (AV_RL32(&p->buf[0]) == LPF_TAG &&
> > > +        AV_RL32(&p->buf[16]) == ANIM_TAG &&
> > 
> > AV_RN32(p->buf     ) == AV_RN32("LPF ") &&
> > AV_RN32(p->buf + 16) == AV_RN32("ANIM") &&
> > 
> > Seems nicer to me.
> 
> Also seems bloatier! Unless the compiler has telepathic qualities, it's
> going to shove the "LPF " string in the data segment.

Then by your definition gcc has such telepathic qualities.
Also I can't see how having that string in the data segment is much of
an issue.
Though memcmp(p->buf, "LPF ", 4) actually is probably better still,
speed and 5 bytes data bloat really don't matter here.

> Besides, this only
> looks nice when working with little endian tags...

Huh? You can also use RL or RB as necessary, it looks the same.

> > That will probably mean your code can't work with AVFMT_GENERIC_INDEX.
> > I really think that seeking should be working.
> 
> There is only one guaranteed keyframe: the first frame!

For normal playback I've always considered seeking to non-keyframes,
too, a good idea. The only real issue I have with it is that just too
many decoders had the habit of crashing often with that.



More information about the ffmpeg-devel mailing list