changeset 4455:8ecfb7ecbb53 libavcodec

Add decode_end method to bmp decoder. Patch by Michel Bardiaux, mbardiaux mediaxim dot be.
author takis
date Thu, 01 Feb 2007 09:48:09 +0000
parents c9ce397604f0
children 33f181383a21
files bmp.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bmp.c	Thu Feb 01 09:47:36 2007 +0000
+++ b/bmp.c	Thu Feb 01 09:48:09 2007 +0000
@@ -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
 };