lavc/mjpegdec: consume SOS data even if the frame is discarded
authorMatthieu Bouron <matthieu.bouron@gmail.com>
Sat, 28 Jan 2017 12:49:52 +0000 (13:49 +0100)
committerMatthieu Bouron <matthieu.bouron@gmail.com>
Sun, 29 Jan 2017 20:54:16 +0000 (21:54 +0100)
Speeds up next marker search when a SOS marker is found but the frame is
discarded (which happens in avformat_find_stream_info).

libavcodec/mjpegdec.c

index 7d17e3d..07988b6 100644 (file)
@@ -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))