[Ffmpeg-cvslog] r7796 - trunk/libavcodec/bmp.c

Michael Niedermayer michaelni
Thu Feb 1 13:29:02 CET 2007


Hi

On Thu, Feb 01, 2007 at 10:32:59AM -0000, M?ns Rullg?rd wrote:
> 
> takis said:
> > Author: takis
> > Date: Thu Feb  1 10:48:09 2007
> > New Revision: 7796
> >
> > Modified:
> >    trunk/libavcodec/bmp.c
> >
> > Log:
> > Add decode_end method to bmp decoder. Patch by Michel Bardiaux,
> > mbardiaux mediaxim dot be.
> >
> >
> > Modified: trunk/libavcodec/bmp.c
> > ==============================================================================
> > --- trunk/libavcodec/bmp.c	(original)
> > +++ trunk/libavcodec/bmp.c	Thu Feb  1 10:48:09 2007
> > @@ -232,6 +232,16 @@
> >      return buf_size;
> >  }
> >
> > +static int bmp_decode_end(AVCodecContext *avctx)
> > +{
> > +    BMPContext* c = avctx->priv_data;
> > +
> > +    if (c->picture.data[0])
> > +        avctx->release_buffer(avctx, &c->picture);
> > +
> > +    return 0;
> > +}
> > +
> >  AVCodec bmp_decoder = {
> >      "bmp",
> >      CODEC_TYPE_VIDEO,
> > @@ -239,6 +249,6 @@
> >      sizeof(BMPContext),
> >      bmp_decode_init,
> >      NULL,
> > -    NULL,
> > +    bmp_decode_end,
> >      bmp_decode_frame
> >  };
> 
> IMHO we should come up with a way to avoid replicating this type of boilerplate
> code all over the place.

well that either needs the AVFrames to be stored at a standard location or
a ff_get_buffer() / ff_release_buffer() which keep track of what has been
released and then call AVCodecContext.get/release_buffer()

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20070201/ade0f1b2/attachment.pgp>



More information about the ffmpeg-cvslog mailing list