mirror of https://git.ffmpeg.org/ffmpeg.git
prores: only call get_buffer once per frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ebba05b3c5
commit
e1b2f6ec11
|
@ -575,6 +575,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||||
buf += frame_hdr_size;
|
buf += frame_hdr_size;
|
||||||
buf_size -= frame_hdr_size;
|
buf_size -= frame_hdr_size;
|
||||||
|
|
||||||
|
if (frame->data[0])
|
||||||
|
avctx->release_buffer(avctx, frame);
|
||||||
|
|
||||||
|
if (avctx->get_buffer(avctx, frame) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
decode_picture:
|
decode_picture:
|
||||||
pic_size = decode_picture_header(avctx, buf, buf_size);
|
pic_size = decode_picture_header(avctx, buf, buf_size);
|
||||||
if (pic_size < 0) {
|
if (pic_size < 0) {
|
||||||
|
@ -582,12 +588,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame->data[0])
|
|
||||||
avctx->release_buffer(avctx, frame);
|
|
||||||
|
|
||||||
if (avctx->get_buffer(avctx, frame) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (decode_picture(avctx)) {
|
if (decode_picture(avctx)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "error decoding picture\n");
|
av_log(avctx, AV_LOG_ERROR, "error decoding picture\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue