aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-11-04 23:22:28 +0100
committerClément Bœsch <ubitux@gmail.com>2012-11-05 07:37:45 +0100
commita8b3130181f6f7d3eb491e9589ee0a7c1a0c870a (patch)
tree31f7a691c1fac854f8a597e83d0bad02a8a50523 /libavformat
parentc673ef12885fdc007b21b9f52cdd50211d452d97 (diff)
downloadffmpeg-a8b3130181f6f7d3eb491e9589ee0a7c1a0c870a.tar.gz
lavf/srtdec: recognize subtitles starting at event index 0.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/srtdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 4f5f0953f8..9089331849 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -32,7 +32,8 @@ static int srt_probe(AVProbeData *p)
ptr += 3; /* skip UTF-8 BOM */
for (i=0; i<2; i++) {
- if (num == i && sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
+ if ((num == i || num + 1 == i)
+ && sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
return AVPROBE_SCORE_MAX;
num = atoi(ptr);
ptr += strcspn(ptr, "\n") + 1;