diff options
author | Martin Storsjö <martin@martin.st> | 2011-11-07 23:20:31 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-11-16 11:22:41 +0200 |
commit | 627067118c6674dd944df962d24cf386afcd4326 (patch) | |
tree | d9b589e4fc6c326537f2d4ac500aa0f2045a3b71 /libavutil/parseutils.c | |
parent | 747283a0788b088872ca58d3d15bb2ec5349dcb0 (diff) | |
download | ffmpeg-627067118c6674dd944df962d24cf386afcd4326.tar.gz |
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>
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r-- | libavutil/parseutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |