diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-05-31 21:12:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-07 00:55:24 +0200 |
commit | 662ab44c2de55b674f6b596890a9ab1afdce1aca (patch) | |
tree | a3f07eee3aa25c8597f68934ba5dc1b95c6fa01e | |
parent | cc0a6844973da4c855c399322bc6c6ee8ca8c204 (diff) | |
download | ffmpeg-662ab44c2de55b674f6b596890a9ab1afdce1aca.tar.gz |
jacosub_probe: speedup by making only one call to sscanf
(cherry picked from commit 908293d1bcaa0e059561bec8ae0b3ad1fde2d196)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/jacosubdec.c | 7 |
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; |