[FFmpeg-cvslog] lavf/srtdec: fix probing files with negative first timestamps

Rodger Combs git at videolan.org
Sat Jun 25 22:51:34 CEST 2016


ffmpeg | branch: master | Rodger Combs <rodger.combs at gmail.com> | Mon Jun  6 13:26:36 2016 -0500| [1df401505c6d209961016ba881d18bedf6af61eb] | committer: Rodger Combs

lavf/srtdec: fix probing files with negative first timestamps

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1df401505c6d209961016ba881d18bedf6af61eb
---

 libavformat/srtdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 585aa6a..9ab7a4e 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -52,7 +52,10 @@ static int srt_probe(AVProbeData *p)
     /* Check if the next line matches a SRT timestamp */
     if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
         return 0;
-    if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
+    pbuf = buf;
+    if (buf[0] == '-')
+      pbuf++;
+    if (pbuf[0] >= '0' && pbuf[0] <= '9' && strstr(buf, " --> ")
         && sscanf(buf, "%*d:%*d:%*d%*1[,.]%*d --> %*d:%*d:%*d%*1[,.]%d", &v) == 1)
         return AVPROBE_SCORE_MAX;
 



More information about the ffmpeg-cvslog mailing list