mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mm decoder: move buffer allocation from decode_init() to decode_frame()
This permits playback in ffplay when libavfilter is enabled. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
parent
7f05c164d8
commit
6e7cf13b6b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user