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>
API changes, most recent first:
API changes, most recent first:
+2011-11-xx - xxxxxxx - lavu 51.16.0
+ Add av_timegm()
+
2011-11-06 - ba04ecf - lavu 51.14.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
2011-11-06 - ba04ecf - lavu 51.14.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 15
+#define LIBAVUTIL_VERSION_MINOR 16
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-static time_t mktimegm(struct tm *tm)
+time_t av_timegm(struct tm *tm)
} else {
dt.tm_isdst = -1; /* unknown */
if (is_utc) {
} else {
dt.tm_isdst = -1; /* unknown */
if (is_utc) {
} else {
t = mktime(&dt);
}
} else {
t = mktime(&dt);
}
#ifndef AVUTIL_PARSEUTILS_H
#define AVUTIL_PARSEUTILS_H
#ifndef AVUTIL_PARSEUTILS_H
#define AVUTIL_PARSEUTILS_H
#include "rational.h"
/**
#include "rational.h"
/**
*/
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
*/
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 */
#endif /* AVUTIL_PARSEUTILS_H */