diff options
author | Senthilnathan M <senthilnathan.maadasamy@gmail.com> | 2013-02-20 09:51:06 +0530 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-02-22 23:43:46 +0100 |
commit | 12a269a5229d3a37be0743fc9655f743ebc44b6e (patch) | |
tree | 0294970f493da9d0fc4f798a9b016e809f5d864a /libavutil/parseutils.c | |
parent | 239b88c284af3025513e5cac6e318d1f9a9cdd71 (diff) | |
download | ffmpeg-12a269a5229d3a37be0743fc9655f743ebc44b6e.tar.gz |
lavu/parseutils: allow MM:SS format for duration in av_parse_time()
Fix trac ticket #2258.
Signed-off-by: Senthilnathan M <senthilnathan.maadasamy@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r-- | libavutil/parseutils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 73e400ac62..c67f971792 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 */ |