[FFmpeg-devel] [PATCH] Allow MM:SS format for duration

Senthilnathan Maadasamy senthilnathan.maadasamy at gmail.com
Wed Feb 20 05:27:58 CET 2013


Fixes ticket 2258

Signed-off-by: Senthilnathan M <senthilnathan.maadasamy at gmail.com>
---
 libavutil/parseutils.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 73e400a..c67f971 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -588,6 +588,11 @@ int av_parse_time(int64_t *timeval, const char
*timestr, int duration)
         /* parse timestr as HH:MM:SS */
         q = av_small_strptime(p, "%J:%M:%S", &dt);
         if (!q) {
+            /* parse timestr as MM:SS */
+            q = av_small_strptime(p, "%M:%S", &dt);
+            dt.tm_hour = 0;
+        }
+        if (!q) {
             /* parse timestr as S+ */
             dt.tm_sec = strtol(p, (void *)&q, 10);
             if (q == p) /* the parsing didn't succeed */
-- 
1.7.9.5


More information about the ffmpeg-devel mailing list