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:

committed by
Stefano Sabatini

parent
239b88c284
commit
12a269a522
@@ -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);
|
||||
|
Reference in New Issue
Block a user