]> git.sesse.net Git - ffmpeg/commitdiff
lavf/mpsub: remove sscanf from probing.
authorClément Bœsch <ubitux@gmail.com>
Mon, 6 May 2013 20:48:36 +0000 (22:48 +0200)
committerClément Bœsch <ubitux@gmail.com>
Mon, 6 May 2013 20:50:59 +0000 (22:50 +0200)
This should make probing faster.

libavformat/mpsubdec.c

index 11b8e2ed68a34ad81011db55bd0fdd8855a1ee55..6a0cefbeb68e1537b1b4fffa248146ca844f534b 100644 (file)
@@ -37,11 +37,10 @@ static int mpsub_probe(AVProbeData *p)
     const char *ptr_end = p->buf + p->buf_size;
 
     while (ptr < ptr_end) {
-        int n;
-
-        if (!memcmp(ptr, "FORMAT=TIME", 11) ||
-            sscanf(ptr, "FORMAT=%d", &n) == 1)
+        if (!memcmp(ptr, "FORMAT=TIME", 11))
             return AVPROBE_SCORE_EXTENSION;
+        if (!memcmp(ptr, "FORMAT=", 7))
+            return AVPROBE_SCORE_EXTENSION / 3;
         ptr += strcspn(ptr, "\n") + 1;
     }
     return 0;