summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavutil/parseutils.c
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-10-01 14:34:26 +0200
committerGitHub <noreply@github.com>2018-10-01 14:34:26 +0200
commit79b00fc33b5cb6d56d29b50efac6d62ce3a89018 (patch)
tree77d8179bb3d9d76d9ec4fcfe396a35afcc8f73cd /media/ffvpx/libavutil/parseutils.c
parentab881a3bf513e591b6cc2966560cdab2b63a0f2a (diff)
parent7d1ee0e5e4958175ccde5d153b025f97a17caeb2 (diff)
downloadUXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar.gz
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar.lz
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar.xz
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.zip
Merge pull request #801 from trav90/update-from-upstream
Update ffvpx code to 4.0.2
Diffstat (limited to 'media/ffvpx/libavutil/parseutils.c')
-rw-r--r--media/ffvpx/libavutil/parseutils.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/media/ffvpx/libavutil/parseutils.c b/media/ffvpx/libavutil/parseutils.c
index be4ea1ee1..9de19d1c1 100644
--- a/media/ffvpx/libavutil/parseutils.c
+++ b/media/ffvpx/libavutil/parseutils.c
@@ -590,7 +590,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
int64_t t, now64;
time_t now;
struct tm dt = { 0 }, tmbuf;
- int today = 0, negative = 0, microseconds = 0;
+ int today = 0, negative = 0, microseconds = 0, suffix = 1000000;
int i;
static const char * const date_fmt[] = {
"%Y - %m - %d",
@@ -689,6 +689,16 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
if (duration) {
t = dt.tm_hour * 3600 + dt.tm_min * 60 + dt.tm_sec;
+ if (q[0] == 'm' && q[1] == 's') {
+ suffix = 1000;
+ microseconds /= 1000;
+ q += 2;
+ } else if (q[0] == 'u' && q[1] == 's') {
+ suffix = 1;
+ microseconds = 0;
+ q += 2;
+ } else if (*q == 's')
+ q++;
} else {
int is_utc = *q == 'Z' || *q == 'z';
int tzoffset = 0;
@@ -724,7 +734,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
if (*q)
return AVERROR(EINVAL);
- t *= 1000000;
+ t *= suffix;
t += microseconds;
*timeval = negative ? -t : t;
return 0;