From f7813a5324be39d13ab536c245d15dfc602a7849 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 29 Dec 2013 12:19:38 +0000 Subject: basic type mechanism working --- ffmpeg/libavformat/jacosubdec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ffmpeg/libavformat/jacosubdec.c') diff --git a/ffmpeg/libavformat/jacosubdec.c b/ffmpeg/libavformat/jacosubdec.c index 89e7e1b..e77ab40 100644 --- a/ffmpeg/libavformat/jacosubdec.c +++ b/ffmpeg/libavformat/jacosubdec.c @@ -43,8 +43,9 @@ typedef struct { static int timed_line(const char *ptr) { char c; + int fs, fe; return (sscanf(ptr, "%*u:%*u:%*u.%*u %*u:%*u:%*u.%*u %c", &c) == 1 || - sscanf(ptr, "@%*u @%*u %c", &c) == 1); + (sscanf(ptr, "@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe)); } static int jacosub_probe(AVProbeData *p) @@ -60,10 +61,10 @@ static int jacosub_probe(AVProbeData *p) ptr++; if (*ptr != '#' && *ptr != '\n') { if (timed_line(ptr)) - return AVPROBE_SCORE_MAX/2 + 1; + return AVPROBE_SCORE_EXTENSION + 1; return 0; } - ptr += strcspn(ptr, "\n") + 1; + ptr += ff_subtitles_next_line(ptr); } return 0; } -- cgit v1.2.3