1
0
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:
Martin Storsjö
2011-11-07 23:20:31 +02:00
parent 747283a078
commit 627067118c
4 changed files with 13 additions and 3 deletions

View File

@@ -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);
}