From c368538667121fb20c5414dfaf0fb273035a0854 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 4 Sep 2014 21:16:13 +0200 Subject: [PATCH] avformat/srtdec: speed up probing --- libavformat/srtdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c index b63d3444d3..f5f3933916 100644 --- a/libavformat/srtdec.c +++ b/libavformat/srtdec.c @@ -43,6 +43,7 @@ static int srt_probe(AVProbeData *p) if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0) break; if ((num == i || num + 1 == i) + && buf[0] >= '0' && buf[1] <= '9' && strstr(buf, " --> ") && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1) return AVPROBE_SCORE_MAX; num = atoi(buf);