Commit 12a269a5 authored by Senthilnathan M's avatar Senthilnathan M Committed by Stefano Sabatini

lavu/parseutils: allow MM:SS format for duration in av_parse_time()

Fix trac ticket #2258.
Signed-off-by: 's avatarSenthilnathan M <senthilnathan.maadasamy@gmail.com>
Signed-off-by: 's avatarStefano Sabatini <stefasab@gmail.com>
parent 239b88c2
......@@ -98,7 +98,7 @@ year-month-day.
The accepted syntax is:
@example
[-]HH:MM:SS[.m...]
[-][HH:]MM:SS[.m...]
[-]S+[.m...]
@end example
......
......@@ -587,6 +587,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);
......
......@@ -122,7 +122,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
* year-month-day.
* - If a duration the syntax is:
* @code
* [-]HH:MM:SS[.m...]]]
* [-][HH:]MM:SS[.m...]]]
* [-]S+[.m...]
* @endcode
* @param duration flag which tells how to interpret timestr, if not
......
......@@ -76,7 +76,7 @@
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 17
#define LIBAVUTIL_VERSION_MICRO 102
#define LIBAVUTIL_VERSION_MICRO 103
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment