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>
This commit is contained in:
Marton Balint 2018-03-06 00:45:09 +01:00
parent cf5ffe0183
commit 8d37dd6ed3
1 changed files with 3 additions and 4 deletions

View File

@ -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';