From 7af3f27008b8406143a544f90590fd335806c1d7 Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Fri, 18 Mar 2016 16:41:20 +0100 Subject: lavf/srtdec: do not be strict wrt timing digit lengths Fixes a sample with 3-length digits for the seconds reported by wm4. --- libavformat/srtdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c index 6113f70562..3734d39d3b 100644 --- a/libavformat/srtdec.c +++ b/libavformat/srtdec.c @@ -53,7 +53,7 @@ static int srt_probe(AVProbeData *p) if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0) return 0; if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ") - && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1) + && sscanf(buf, "%*d:%*d:%*d%*1[,.]%*d --> %*d:%*d:%*d%*1[,.]%d", &v) == 1) return AVPROBE_SCORE_MAX; return 0; @@ -74,7 +74,7 @@ static int get_event_info(const char *line, struct event_info *ei) ei->x1 = ei->x2 = ei->y1 = ei->y2 = ei->duration = -1; ei->pts = AV_NOPTS_VALUE; ei->pos = -1; - if (sscanf(line, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d" + if (sscanf(line, "%d:%d:%d%*1[,.]%d --> %d:%d:%d%*1[,.]%d" "%*[ ]X1:%u X2:%u Y1:%u Y2:%u", &hh1, &mm1, &ss1, &ms1, &hh2, &mm2, &ss2, &ms2, -- cgit v1.2.3