summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2017-01-28 13:49:52 +0100
committerMatthieu Bouron <matthieu.bouron@gmail.com>2017-01-29 21:54:16 +0100
commit2ae82788324481dd56bb85f9d815902854c044fd (patch)
tree63597910e5396968c43051c003e3c45fc5d2e6da /libavcodec/mjpegdec.c
parent383057f8e744efeaaa3648a59bc577b25b055835 (diff)
downloadffmpeg-2ae82788324481dd56bb85f9d815902854c044fd.tar.gz
lavc/mjpegdec: consume SOS data even if the frame is discarded
Speeds up next marker search when a SOS marker is found but the frame is discarded (which happens in avformat_find_stream_info).
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7d17e3dfcb..07988b68b1 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2247,8 +2247,10 @@ eoi_parser:
goto the_end;
case SOS:
s->cur_scan++;
- if (avctx->skip_frame == AVDISCARD_ALL)
+ if (avctx->skip_frame == AVDISCARD_ALL) {
+ skip_bits(&s->gb, get_bits_left(&s->gb));
break;
+ }
if ((ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL)) < 0 &&
(avctx->err_recognition & AV_EF_EXPLODE))