[FFmpeg-cvslog] lavf/srtdec: do not be strict wrt timing digit lengths
Clément Bœsch
git at videolan.org
Fri Mar 18 16:44:23 CET 2016
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri Mar 18 16:41:20 2016 +0100| [7af3f27008b8406143a544f90590fd335806c1d7] | committer: Clément Bœsch
lavf/srtdec: do not be strict wrt timing digit lengths
Fixes a sample with 3-length digits for the seconds reported by wm4.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7af3f27008b8406143a544f90590fd335806c1d7
---
libavformat/srtdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 6113f70..3734d39 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,
More information about the ffmpeg-cvslog
mailing list