[SCM] libav/experimental: Call release_buffer on close for v210dec and v210x

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:52:52 UTC 2013


The following commit has been merged in the experimental branch:
commit 0fbb0185b999169a265e5fac2145483dacd73e74
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Tue Oct 13 18:31:22 2009 +0000

    Call release_buffer on close for v210dec and v210x
    
    Originally committed as revision 20228 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 0d71b50..08c954d 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -114,6 +114,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_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;
diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c
index 754b70a..fe1b6de 100644
--- a/libavcodec/v210x.c
+++ b/libavcodec/v210x.c
@@ -124,6 +124,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     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 @@ AVCodec v210x_decoder = {
     0,
     decode_init,
     NULL,
-    NULL,
+    decode_close,
     decode_frame,
     CODEC_CAP_DR1,
 };

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list