[FFmpeg-cvslog] Release old pictures after a resolution change in vp5/6 decoder

Laurent Aimar git at videolan.org
Sun Nov 6 20:18:52 CET 2011


ffmpeg | branch: release/0.5 | Laurent Aimar <fenrir at videolan.org> | Wed Sep 21 20:46:33 2011 +0200| [b24c2e59fec0342a57af86eaec3080e264894276] | committer: Michael Niedermayer

Release old pictures after a resolution change in vp5/6 decoder

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit dba20b84784a7931b7eac50ced1d43e86801bde9)
(cherry picked from commit c9c6e5f4e8680b7b7801dd6943590ae9cd6bfd89)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b24c2e59fec0342a57af86eaec3080e264894276
---

 libavcodec/vp56.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index ad11b52..65ddb8b 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -519,6 +519,16 @@ int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         if (!res)
             return -1;
 
+        if (res == 2) {
+            int i;
+            for (i = 0; i < 4; i++) {
+                if (s->frames[i].data[0])
+                    avctx->release_buffer(avctx, &s->frames[i]);
+            }
+            if (is_alpha)
+                return -1;
+        }
+
         if (!is_alpha) {
             p->reference = 1;
             if (avctx->get_buffer(avctx, p) < 0) {



More information about the ffmpeg-cvslog mailing list