[FFmpeg-cvslog] avutil/parseutils: only accept full us duration, do not accept mss duration
Marton Balint
git at videolan.org
Fri Mar 9 23:06:14 EET 2018
ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Mar 6 00:45:09 2018 +0100| [8d37dd6ed3bc3de6b6aa2bdc46f87e842ee19054] | committer: Marton Balint
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 at passwd.hu>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d37dd6ed3bc3de6b6aa2bdc46f87e842ee19054
---
libavutil/parseutils.c | 7 +++----
1 file 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';
More information about the ffmpeg-cvslog
mailing list