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:
Senthilnathan M
2013-02-20 09:51:06 +05:30
committed by Stefano Sabatini
parent 239b88c284
commit 12a269a522
4 changed files with 8 additions and 3 deletions

View File

@@ -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);