lavu/parseutils: accept %J for hours >= 24.

Allow to parse durations >= 24:00:00.
This commit is contained in:
Nicolas George 2012-12-01 16:58:51 +01:00
parent b61ba262a1
commit 86a2486812
3 changed files with 5 additions and 3 deletions

View file

@ -454,7 +454,8 @@ char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
c = *fmt++;
switch(c) {
case 'H':
val = date_get_num(&p, 0, 23, 2);
case 'J':
val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, 2);
if (val == -1)
return NULL;
dt->tm_hour = val;
@ -581,7 +582,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
++p;
}
/* parse timestr as HH:MM:SS */
q = av_small_strptime(p, time_fmt[0], &dt);
q = av_small_strptime(p, "%J:%M:%S", &dt);
if (!q) {
/* parse timestr as S+ */
dt.tm_sec = strtol(p, (void *)&q, 10);