ffmpeg | branch: master | Matthieu Bouron <matthieu.bou...@gmail.com> | Sat Jan 
28 13:49:52 2017 +0100| [2ae82788324481dd56bb85f9d815902854c044fd] | committer: 
Matthieu Bouron

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).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ae82788324481dd56bb85f9d815902854c044fd
---

 libavcodec/mjpegdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7d17e3d..07988b6 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))

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to