[FFmpeg-cvslog] jacosub_probe: speedup by making only one call to sscanf

Clément Bœsch git at videolan.org
Thu Jun 7 01:44:18 CEST 2012


ffmpeg | branch: release/0.11 | Clément Bœsch <ubitux at gmail.com> | Thu May 31 21:12:25 2012 +0200| [662ab44c2de55b674f6b596890a9ab1afdce1aca] | committer: Michael Niedermayer

jacosub_probe: speedup by making only one call to sscanf
(cherry picked from commit 908293d1bcaa0e059561bec8ae0b3ad1fde2d196)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=662ab44c2de55b674f6b596890a9ab1afdce1aca
---

 libavformat/jacosubdec.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 30c4f63..615191e 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;



More information about the ffmpeg-cvslog mailing list