diff options
author | Peter Ross <pross@xvid.org> | 2011-03-13 16:21:52 +1100 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2011-03-13 16:24:12 +1100 |
commit | 6e1f0d5edf720afa835fb97e0f74b51848323b6d (patch) | |
tree | 74fa98bbb5aa0a5a7c1bbdd1c474faa04f8ac15a /libavcodec/mmvideo.c | |
parent | 435535e41159fbe7423a12078d684329a554776d (diff) | |
download | ffmpeg-6e1f0d5edf720afa835fb97e0f74b51848323b6d.tar.gz |
mm decoder: move buffer allocation from decode_init() to decode_frame().
this permits playback in ffplay when libavfilter is enabled.
Diffstat (limited to 'libavcodec/mmvideo.c')
-rw-r--r-- | libavcodec/mmvideo.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 60e00fbe29..92420b1d25 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -59,10 +59,6 @@ static av_cold int mm_decode_init(AVCodecContext *avctx) avctx->pix_fmt = PIX_FMT_PAL8; s->frame.reference = 1; - if (avctx->get_buffer(avctx, &s->frame)) { - av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; - } return 0; } @@ -182,6 +178,11 @@ static int mm_decode_frame(AVCodecContext *avctx, buf += MM_PREAMBLE_SIZE; buf_size -= MM_PREAMBLE_SIZE; + if (avctx->reget_buffer(avctx, &s->frame) < 0) { + av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); + return -1; + } + switch(type) { case MM_TYPE_PALETTE : mm_decode_pal(s, buf, buf_end); return buf_size; case MM_TYPE_INTRA : mm_decode_intra(s, 0, 0, buf, buf_size); break; |