summaryrefslogtreecommitdiff
path: root/libavformat/jacosubdec.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-05-31 21:12:25 +0200
committerClément Bœsch <ubitux@gmail.com>2012-05-31 21:55:35 +0200
commit908293d1bcaa0e059561bec8ae0b3ad1fde2d196 (patch)
tree229569660fa004ba54642ed0f20fa987c8d50b38 /libavformat/jacosubdec.c
parent5afdb3e6b1a06a897ec6d4fe5da1619ae8bef6be (diff)
downloadffmpeg-908293d1bcaa0e059561bec8ae0b3ad1fde2d196.tar.gz
jacosub_probe: speedup by making only one call to sscanf
Diffstat (limited to 'libavformat/jacosubdec.c')
-rw-r--r--libavformat/jacosubdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 30c4f636bd..615191ee3f 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -63,10 +63,13 @@ static int jacosub_probe(AVProbeData *p)
ptr += 3; /* skip UTF-8 BOM */
while (ptr < ptr_end) {
- if (timed_line(ptr))
- return AVPROBE_SCORE_MAX / 2;
while (jss_whitespace(*ptr))
ptr++;
+ if (*ptr != '#' && *ptr != '\n') {
+ if (timed_line(ptr))
+ return AVPROBE_SCORE_MAX / 2;
+ return 0;
+ }
ptr += strcspn(ptr, "\n") + 1;
}
return 0;