It's an XSI extension, not available on some supported systems.
---
 configure            |    2 ++
 libavformat/dvenc.c  |    5 +++++
 libavformat/gxfenc.c |    5 +++++
 libavformat/movenc.c |    5 +++++
 libavformat/mxfenc.c |    5 +++++
 5 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 02bcd09..596b603 100755
--- a/configure
+++ b/configure
@@ -1105,6 +1105,7 @@ HAVE_LIST="
     poll_h
     setrlimit
     strerror_r
+    strptime
     strtok_r
     struct_addrinfo
     struct_ipv6_mreq
@@ -2775,6 +2776,7 @@ check_func  mmap
 check_func  ${malloc_prefix}posix_memalign      && enable posix_memalign
 check_func  setrlimit
 check_func  strerror_r
+check_func  strptime
 check_func  strtok_r
 check_func_headers io.h setmode
 check_func_headers lzo/lzo1x.h lzo1x_999_compress
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 1e59bd9..d419248 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -344,9 +344,14 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
     else
 #endif
     if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
+#if HAVE_STRPTIME
         struct tm time = {0};
         strptime(t->value, "%Y - %m - %dT%T", &time);
         c->start_time = mktime(&time);
+#else
+        av_log(s, AV_LOG_WARNING, "Strptime unavailable on this system, cannot 
write "
+                                  "creation timestamp.\n");
+#endif
     }
 
     for (i=0; i < c->n_ast; i++) {
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 2d4136a..a968a53 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -403,9 +403,14 @@ static int 
gxf_write_umf_material_description(AVFormatContext *s)
     else
 #endif
     if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
+#if HAVE_STRPTIME
         struct tm time = {0};
         strptime(t->value, "%Y - %m - %dT%T", &time);
         timestamp = mktime(&time);
+#else
+        av_log(s, AV_LOG_WARNING, "Strptime unavailable on this system, cannot 
write "
+                                  "creation timestamp.\n");
+#endif
     }
 
 
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 78e5db7..ebdad3b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2267,9 +2267,14 @@ static int mov_write_header(AVFormatContext *s)
     else
 #endif
     if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
+#if HAVE_STRPTIME
         struct tm time = {0};
         strptime(t->value, "%Y - %m - %dT%T", &time);
         mov->time = mktime(&time);
+#else
+        av_log(s, AV_LOG_WARNING, "Strptime unavailable on this system, cannot 
write "
+                                  "creation timestamp.\n");
+#endif
     }
     mov->time += 0x7C25B080; //1970 based -> 1904 based
 
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index d7cc5c1..90f39c5 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1520,9 +1520,14 @@ static int mxf_write_header(AVFormatContext *s)
     else
 #endif
     if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
+#if HAVE_STRPTIME
         struct tm time = {0};
         strptime(t->value, "%Y - %m - %dT%T", &time);
         timestamp = mktime(&time);
+#else
+        av_log(s, AV_LOG_WARNING, "Strptime unavailable on this system, cannot 
write "
+                                  "creation timestamp.\n");
+#endif
     }
     if (timestamp)
         mxf->timestamp = mxf_parse_timestamp(timestamp);
-- 
1.7.5.3

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to