[FFmpeg-devel] [PATCH] qpeg: use reget_buffer() in decode_frame()

Stefano Sabatini stefano.sabatini-lala at poste.it
Tue Apr 26 11:53:25 CEST 2011


Also remove unnecessary call to avctx->release_buffer(). reget_buffer
is required since apparently the coded needs to be passed the previous
frame data again.

Releasing the frame and using get_buffer was working only in the case
get_buffer() was returning the old frame data again, and resulting in
playback artifacts otherwise.

Fix trac issue #79.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>
---
 libavcodec/qpeg.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index dda5525..09cf1dc 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -259,12 +259,9 @@ static int decode_frame(AVCodecContext *avctx,
     int delta;
     const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
 
-    if(p->data[0])
-        avctx->release_buffer(avctx, p);
-
     p->reference= 0;
-    if(avctx->get_buffer(avctx, p) < 0){
-        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+    if (avctx->reget_buffer(avctx, p) < 0) {
+        av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
         return -1;
     }
     outdata = a->pic.data[0];
-- 
1.7.2.3



More information about the ffmpeg-devel mailing list