[FFmpeg-devel] [PATCH] parseutils: ignore digits below the microsecond.

Nicolas George nicolas.george at normalesup.org
Tue Jul 10 19:14:15 CEST 2012


Accept 1.1234567 as simply 1.123456 instead of rejecting it.
The rounding is towards 0, which is acceptable and much simpler.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavutil/parseutils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 795236c..22c45db 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -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) {
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list