diff options
Diffstat (limited to 'ffmpeg/libavformat/mpsubdec.c')
| -rw-r--r-- | ffmpeg/libavformat/mpsubdec.c | 16 |
1 files changed, 10 insertions, 6 deletions
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; } |
