diff options
author | Clément Bœsch <u@pkh.me> | 2016-03-18 16:41:20 +0100 |
---|---|---|
committer | Clément Bœsch <clement@stupeflix.com> | 2016-03-18 16:42:07 +0100 |
commit | 7af3f27008b8406143a544f90590fd335806c1d7 (patch) | |
tree | c30b79cafe58c7c4277db85da3bb60aba66e848c /libavformat/srtdec.c | |
parent | bccc81dfa08e6561df6ed37860e3a08f7d983825 (diff) | |
download | ffmpeg-7af3f27008b8406143a544f90590fd335806c1d7.tar.gz |
lavf/srtdec: do not be strict wrt timing digit lengths
Fixes a sample with 3-length digits for the seconds reported by wm4.
Diffstat (limited to 'libavformat/srtdec.c')
-rw-r--r-- | libavformat/srtdec.c | 4 |
1 files 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, |