aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@stupeflix.com>2016-03-01 18:15:48 +0100
committerMatthieu Bouron <matthieu.bouron@stupeflix.com>2016-03-07 12:36:23 +0100
commit81f14884b59334b765eddb64b0dc8ca5dec7f9bd (patch)
treeedc71f1bd37af01b99e4624fdb6e74fbb1f1592a /libavcodec/mjpegdec.c
parentbba9bed3f3b1608dc70c01ff9e31d36e497db025 (diff)
downloadffmpeg-81f14884b59334b765eddb64b0dc8ca5dec7f9bd.tar.gz
lavc/mjpegdec: avoid unneeded allocation if the frame is to be skipped
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index f41f3a5b5d..1e83e88482 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -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;