diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/jacosubdec.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/jacosubdec.c')
| -rw-r--r-- | ffmpeg/libavformat/jacosubdec.c | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |
