changeset 10396:2bb3882075b6 libavcodec

Call release_buffer on close for v210dec and v210x
author reimar
date Tue, 13 Oct 2009 18:31:22 +0000
parents d02739e638cf
children d7ed9dcc78e3
files v210dec.c v210x.c
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/v210dec.c	Tue Oct 13 18:28:37 2009 +0000
+++ b/v210dec.c	Tue Oct 13 18:31:22 2009 +0000
@@ -114,6 +114,9 @@
 
 static av_cold int decode_close(AVCodecContext *avctx)
 {
+    AVFrame *pic = avctx->coded_frame;
+    if (pic->data[0])
+        avctx->release_buffer(avctx, pic);
     av_freep(&avctx->coded_frame);
 
     return 0;
--- a/v210x.c	Tue Oct 13 18:28:37 2009 +0000
+++ b/v210x.c	Tue Oct 13 18:31:22 2009 +0000
@@ -124,6 +124,16 @@
     return avpkt->size;
 }
 
+static av_cold int decode_close(AVCodecContext *avctx)
+{
+    AVFrame *pic = avctx->coded_frame;
+    if (pic->data[0])
+        avctx->release_buffer(avctx, pic);
+    av_freep(&avctx->coded_frame);
+
+    return 0;
+}
+
 AVCodec v210x_decoder = {
     "v210x",
     CODEC_TYPE_VIDEO,
@@ -131,7 +141,7 @@
     0,
     decode_init,
     NULL,
-    NULL,
+    decode_close,
     decode_frame,
     CODEC_CAP_DR1,
 };