aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2014-09-04 21:16:13 +0200
committerClément Bœsch <u@pkh.me>2014-09-05 23:13:08 +0200
commitc368538667121fb20c5414dfaf0fb273035a0854 (patch)
tree8a6b16171fd2db0dd5f44ee7c17d265853fc0527 /libavformat
parentb7f641dc9bff452c0af75700d1127f54dadf4247 (diff)
downloadffmpeg-c368538667121fb20c5414dfaf0fb273035a0854.tar.gz
avformat/srtdec: speed up probing
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/srtdec.c1
1 files changed, 1 insertions, 0 deletions
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);