diff options
author | Marton Balint <cus@passwd.hu> | 2018-03-06 00:45:09 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2018-03-09 22:01:38 +0100 |
commit | 8d37dd6ed3bc3de6b6aa2bdc46f87e842ee19054 (patch) | |
tree | 305bc2d971abb93956c0537b9a9175ea10dd2e07 /libavutil | |
parent | cf5ffe0183947112ac50be81942d8be610aa987c (diff) | |
download | ffmpeg-8d37dd6ed3bc3de6b6aa2bdc46f87e842ee19054.tar.gz |
avutil/parseutils: only accept full us duration, do not accept mss duration
Accepting 'u' suffix for a time specification is neither intuitive nor
consistent (now that we don't accept m). Also there was a bug in the code
accepting an extra 's' even after 'ms'.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/parseutils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 95274f564f..924c49d52c 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -693,12 +693,11 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration) suffix = 1000; microseconds /= 1000; q += 2; - } else if (*q == 'u') { + } else if (q[0] == 'u' && q[1] == 's') { suffix = 1; microseconds = 0; - q++; - } - if (*q == 's') + q += 2; + } else if (*q == 's') q++; } else { int is_utc = *q == 'Z' || *q == 'z'; |