aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/parseutils.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-12-01 16:58:51 +0100
committerNicolas George <nicolas.george@normalesup.org>2012-12-02 11:48:56 +0100
commit86a2486812f14bf513632e425649a534882e56f7 (patch)
tree828bc084cfaa25797c299cad50f03de068a8b340 /libavutil/parseutils.c
parentb61ba262a1e275f8129b7383d70fe48051b47fcf (diff)
downloadffmpeg-86a2486812f14bf513632e425649a534882e56f7.tar.gz
lavu/parseutils: accept %J for hours >= 24.
Allow to parse durations >= 24:00:00.
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r--libavutil/parseutils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index a335978cc1..f188e815fa 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -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);