summaryrefslogtreecommitdiff
path: root/libavformat/mpsubdec.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-05-06 22:48:36 +0200
committerClément Bœsch <ubitux@gmail.com>2013-05-06 22:50:59 +0200
commita82cc54fb5ce3774ac7f4a646e6c3a2388d528bd (patch)
tree3129ee50a7948556dd1100b6d5e5609b77fe9178 /libavformat/mpsubdec.c
parent905e1e4b521bd941c038e0d8fc32175a178dc21c (diff)
downloadffmpeg-a82cc54fb5ce3774ac7f4a646e6c3a2388d528bd.tar.gz
lavf/mpsub: remove sscanf from probing.
This should make probing faster.
Diffstat (limited to 'libavformat/mpsubdec.c')
-rw-r--r--libavformat/mpsubdec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c
index 11b8e2ed68..6a0cefbeb6 100644
--- a/libavformat/mpsubdec.c
+++ b/libavformat/mpsubdec.c
@@ -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;