You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avutil: Add av_timegm as a public function
This is useful, since the normal timegm function isn't a standard function (requiring _BSD_SOURCE or _SVID_SOURCE on glibc to be visible, and not available on e.g. windows). The widely available function mktime uses the local time zone, which requires ugly workarounds to handle UTC time. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@@ -461,7 +461,7 @@ static const char *small_strptime(const char *p, const char *fmt, struct tm *dt)
|
||||
}
|
||||
}
|
||||
|
||||
static time_t mktimegm(struct tm *tm)
|
||||
time_t av_timegm(struct tm *tm)
|
||||
{
|
||||
time_t t;
|
||||
|
||||
@@ -582,7 +582,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
|
||||
} else {
|
||||
dt.tm_isdst = -1; /* unknown */
|
||||
if (is_utc) {
|
||||
t = mktimegm(&dt);
|
||||
t = av_timegm(&dt);
|
||||
} else {
|
||||
t = mktime(&dt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user