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

Laurent Aimar git at videolan.org
Thu Sep 22 01:37:14 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Wed Sep 21 20:46:33 2011 +0200| [c9c6e5f4e8680b7b7801dd6943590ae9cd6bfd89] | 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)

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

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

diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index cf89176..25ec7a3 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -513,6 +513,16 @@ int ff_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