parseutils: ignore digits below the microsecond.
authorNicolas George <nicolas.george@normalesup.org>
Tue, 10 Jul 2012 17:03:12 +0000 (19:03 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Tue, 10 Jul 2012 20:29:08 +0000 (22:29 +0200)
Accept 1.1234567 as simply 1.123456 instead of rejecting it.
The rounding is towards 0, which is acceptable and much simpler.

libavutil/parseutils.c

index 795236c..22c45db 100644 (file)
@@ -610,6 +610,8 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
                 break;
             microseconds += n * (*q - '0');
         }
+        while (isdigit(*q))
+            q++;
     }
 
     if (duration) {