summaryrefslogtreecommitdiffstats
path: root/libavutil/parseutils.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-03-06 00:45:09 +0100
committerMarton Balint <cus@passwd.hu>2018-03-09 22:01:38 +0100
commit8d37dd6ed3bc3de6b6aa2bdc46f87e842ee19054 (patch)
tree305bc2d971abb93956c0537b9a9175ea10dd2e07 /libavutil/parseutils.c
parentcf5ffe0183947112ac50be81942d8be610aa987c (diff)
downloadffmpeg-streaming-8d37dd6ed3bc3de6b6aa2bdc46f87e842ee19054.zip
ffmpeg-streaming-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/parseutils.c')
-rw-r--r--libavutil/parseutils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 95274f5..924c49d 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';
OpenPOWER on IntegriCloud