From 627067118c6674dd944df962d24cf386afcd4326 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 7 Nov 2011 23:20:31 +0200 Subject: avutil: Add av_timegm as a public function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ö --- libavutil/parseutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavutil/parseutils.c') diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index c1647a0e20..a1d221b62a 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -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); } -- cgit v1.2.3