summaryrefslogtreecommitdiff
path: root/libavcodec/vb.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-06-06 08:46:08 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-06-06 08:46:08 +0000
commit10ae4bb477426f6a360bed684c6676e20f2de299 (patch)
treeedcd9e585587086ac034ce062ed8301224e2ce69 /libavcodec/vb.c
parente72c65f583a8a141622b007bc10ee0a8b8e5d80b (diff)
downloadffmpeg-10ae4bb477426f6a360bed684c6676e20f2de299.tar.gz
Get new buffer during frame decoding in VB video decoder, not only once
during decoder initialization. Originally committed as revision 19121 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vb.c')
-rw-r--r--libavcodec/vb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index b95fa1a9c7..02efa030a5 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -185,6 +185,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
int rest = buf_size;
int offset = 0;
+ if(c->pic.data[0])
+ avctx->release_buffer(avctx, &c->pic);
+ c->pic.reference = 1;
+ if(avctx->get_buffer(avctx, &c->pic) < 0){
+ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return -1;
+ }
+
c->stream = buf;
flags = bytestream_get_le16(&c->stream);
rest -= 2;
@@ -247,12 +255,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return -1;
}
- c->pic.reference = 1;
- if(avctx->get_buffer(avctx, &c->pic) < 0){
- av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
-
c->frame = av_malloc( avctx->width * avctx->height);
c->prev_frame = av_malloc( avctx->width * avctx->height);