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>
This commit is contained in:
parent
239b88c284
commit
12a269a522
@ -98,7 +98,7 @@ year-month-day.
|
|||||||
|
|
||||||
The accepted syntax is:
|
The accepted syntax is:
|
||||||
@example
|
@example
|
||||||
[-]HH:MM:SS[.m...]
|
[-][HH:]MM:SS[.m...]
|
||||||
[-]S+[.m...]
|
[-]S+[.m...]
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
@ -587,6 +587,11 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
|
|||||||
}
|
}
|
||||||
/* parse timestr as HH:MM:SS */
|
/* parse timestr as HH:MM:SS */
|
||||||
q = av_small_strptime(p, "%J:%M:%S", &dt);
|
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) {
|
if (!q) {
|
||||||
/* parse timestr as S+ */
|
/* parse timestr as S+ */
|
||||||
dt.tm_sec = strtol(p, (void *)&q, 10);
|
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.
|
* year-month-day.
|
||||||
* - If a duration the syntax is:
|
* - If a duration the syntax is:
|
||||||
* @code
|
* @code
|
||||||
* [-]HH:MM:SS[.m...]]]
|
* [-][HH:]MM:SS[.m...]]]
|
||||||
* [-]S+[.m...]
|
* [-]S+[.m...]
|
||||||
* @endcode
|
* @endcode
|
||||||
* @param duration flag which tells how to interpret timestr, if not
|
* @param duration flag which tells how to interpret timestr, if not
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
#define LIBAVUTIL_VERSION_MAJOR 52
|
#define LIBAVUTIL_VERSION_MAJOR 52
|
||||||
#define LIBAVUTIL_VERSION_MINOR 17
|
#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, \
|
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||||
LIBAVUTIL_VERSION_MINOR, \
|
LIBAVUTIL_VERSION_MINOR, \
|
||||||
|
Loading…
Reference in New Issue
Block a user