提交 81f14884 编写于 作者: M Matthieu Bouron

lavc/mjpegdec: avoid unneeded allocation if the frame is to be skipped

上级 bba9bed3
......@@ -614,6 +614,13 @@ unk_pixfmt:
return AVERROR_BUG;
}
if (s->avctx->skip_frame == AVDISCARD_ALL) {
s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
s->picture_ptr->key_frame = 1;
s->got_picture = 1;
return 0;
}
av_frame_unref(s->picture_ptr);
if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册