You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
lavc/mjpegdec: avoid unneeded allocation if the frame is to be skipped
This commit is contained in:
@ -614,6 +614,13 @@ unk_pixfmt:
|
|||||||
return AVERROR_BUG;
|
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);
|
av_frame_unref(s->picture_ptr);
|
||||||
if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
|
if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user