summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-07-13 09:30:06 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-13 12:14:27 +0200
commit6379900c533d1e556d484e57166873f3ab2505f5 (patch)
tree5c069e5ca7d34245e4c3baba0e721291cc7cbce7 /libavformat
parent001d668d40b5f87d19271c7d5521368b5187425b (diff)
Add a check for strptime().
It's an XSI extension, not available on some supported systems.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index bb12e24d8c..7e79922439 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3887,7 +3887,13 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
int64_t ff_iso8601_to_unix_time(const char *datestr)
{
+#if HAVE_STRPTIME
struct tm time = {0};
strptime(datestr, "%Y - %m - %dT%T", &time);
return mktime(&time);
+#else
+ av_log(NULL, AV_LOG_WARNING, "strptime() unavailable on this system, cannot convert "
+ "the date string.\n");
+ return 0;
+#endif
}