[FFmpeg-cvslog] parseutils: accept only full "ms" suffix

Rostislav Pehlivanov git at videolan.org
Mon Mar 5 22:45:05 EET 2018


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Sat Mar  3 20:17:46 2018 +0000| [8218249f1f04de65904f58519bde21948e5a0783] | committer: Rostislav Pehlivanov

parseutils: accept only full "ms" suffix

The commit which added those was pushed prematurely before anyone could object
to illogical suffixes like just m for milliseconds. Without this, we'd be locked
into never being able to implement the "m" suffix for minutes.

Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>

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

 libavutil/parseutils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 44c845577a..95274f564f 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -689,10 +689,10 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
 
     if (duration) {
         t = dt.tm_hour * 3600 + dt.tm_min * 60 + dt.tm_sec;
-        if (*q == 'm') {
+        if (q[0] == 'm' && q[1] == 's') {
             suffix = 1000;
             microseconds /= 1000;
-            q++;
+            q += 2;
         } else if (*q == 'u') {
             suffix = 1;
             microseconds = 0;



More information about the ffmpeg-cvslog mailing list