avformat/srtdec: speed up probing
authorwm4 <nfxjfg@googlemail.com>
Thu, 4 Sep 2014 19:16:13 +0000 (21:16 +0200)
committerClément Bœsch <u@pkh.me>
Fri, 5 Sep 2014 21:13:08 +0000 (23:13 +0200)
libavformat/srtdec.c

index b63d344..f5f3933 100644 (file)
@@ -43,6 +43,7 @@ static int srt_probe(AVProbeData *p)
         if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
             break;
         if ((num == i || num + 1 == i)
+            && buf[0] >= '0' && buf[1] <= '9' && strstr(buf, " --> ")
             && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
             return AVPROBE_SCORE_MAX;
         num = atoi(buf);