Commit c3685386 authored by wm4's avatar wm4 Committed by Clément Bœsch

avformat/srtdec: speed up probing

parent b7f641dc
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment