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/mpsubdec.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ffmpeg/libavformat/mpsubdec.c') diff --git a/ffmpeg/libavformat/mpsubdec.c b/ffmpeg/libavformat/mpsubdec.c index 2acafaa..c5bdcdb 100644 --- a/ffmpeg/libavformat/mpsubdec.c +++ b/ffmpeg/libavformat/mpsubdec.c @@ -37,12 +37,16 @@ static int mpsub_probe(AVProbeData *p) const char *ptr_end = p->buf + p->buf_size; while (ptr < ptr_end) { - int n; - - if (!memcmp(ptr, "FORMAT=TIME", 11) || - sscanf(ptr, "FORMAT=%d", &n) == 1) - return AVPROBE_SCORE_MAX/2; - ptr += strcspn(ptr, "\n") + 1; + int inc; + + if (!memcmp(ptr, "FORMAT=TIME", 11)) + return AVPROBE_SCORE_EXTENSION; + if (!memcmp(ptr, "FORMAT=", 7)) + return AVPROBE_SCORE_EXTENSION / 3; + inc = ff_subtitles_next_line(ptr); + if (!inc) + break; + ptr += inc; } return 0; } -- cgit v1.2.3