diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-26 11:51:50 +0200 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-04-27 07:44:40 -0700 |
commit | f4e043ff63935a71b98a36bc98b501c36ceadb92 (patch) | |
tree | 12d7c2a0ab26286b0f7a4a1c2e34d57607d991f3 /libavcodec/qpeg.c | |
parent | 4f0b80599a534dcca57be3184b89b98f82bf2a2c (diff) | |
download | ffmpeg-f4e043ff63935a71b98a36bc98b501c36ceadb92.tar.gz |
qpeg: use reget_buffer() in decode_frame()
Decoder relies on previous frame data, so use reget_buffer().
This also set frame->reference to 3, as the frame will be requested
unmodified later so it shouldn't be modified by the application.
Fix playback of file Clock.avi.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/qpeg.c')
-rw-r--r-- | libavcodec/qpeg.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index c96184ff38..5dd2a2d5ca 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"); + p->reference = 3; + if (avctx->reget_buffer(avctx, p) < 0) { + av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return -1; } outdata = a->pic.data[0]; |