[FFmpeg-devel] [PATCH] paf: use reget_bufer() instead of get_buffer()

Paul B Mahol onemda at gmail.com
Mon Jul 30 15:03:50 CEST 2012


Pallete is written to frame->data[1] only if it changes.
This fixes PAL8->PAL8 transcoding.

Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/paf.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavcodec/paf.c b/libavcodec/paf.c
index 0d982d9..5428883 100644
--- a/libavcodec/paf.c
+++ b/libavcodec/paf.c
@@ -247,11 +247,8 @@ static int paf_vid_decode(AVCodecContext *avctx, void *data,
     uint8_t code, *dst, *src, *end;
     int i, frame, ret;
 
-    if (c->pic.data[0])
-        avctx->release_buffer(avctx, &c->pic);
-
-    c->pic.reference = 0;
-    if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0)
+    c->pic.reference = 3;
+    if ((ret = avctx->reget_buffer(avctx, &c->pic)) < 0)
         return ret;
 
     bytestream2_init(&c->gb, pkt->data, pkt->size);
-- 
1.7.7



More information about the ffmpeg-devel mailing list