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.h | |
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.h')
-rw-r--r-- | libavutil/parseutils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/parseutils.h b/libavutil/parseutils.h index 0d78b3ea3b..cd913d8ceb 100644 --- a/libavutil/parseutils.h +++ b/libavutil/parseutils.h @@ -19,6 +19,8 @@ #ifndef AVUTIL_PARSEUTILS_H #define AVUTIL_PARSEUTILS_H +#include <time.h> + #include "rational.h" /** @@ -114,4 +116,9 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration); */ int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); +/** + * Convert the decomposed UTC time in tm to a time_t value. + */ +time_t av_timegm(struct tm *tm); + #endif /* AVUTIL_PARSEUTILS_H */ |