|
|
|
@@ -30,6 +30,7 @@ |
|
|
|
#include "libavutil/channel_layout.h" |
|
|
|
#include "libavutil/intreadwrite.h" |
|
|
|
#include "libavutil/intfloat.h" |
|
|
|
#include "libavutil/time_internal.h" |
|
|
|
#include "avformat.h" |
|
|
|
#include "internal.h" |
|
|
|
#include "wtv.h" |
|
|
|
@@ -386,7 +387,8 @@ static int read_probe(AVProbeData *p) |
|
|
|
static int filetime_to_iso8601(char *buf, int buf_size, int64_t value) |
|
|
|
{ |
|
|
|
time_t t = (value / 10000000LL) - 11644473600LL; |
|
|
|
struct tm *tm = gmtime(&t); |
|
|
|
struct tm tmbuf; |
|
|
|
struct tm *tm = gmtime_r(&t, &tmbuf); |
|
|
|
if (!tm) |
|
|
|
return -1; |
|
|
|
if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm)) |
|
|
|
@@ -401,7 +403,8 @@ static int filetime_to_iso8601(char *buf, int buf_size, int64_t value) |
|
|
|
static int crazytime_to_iso8601(char *buf, int buf_size, int64_t value) |
|
|
|
{ |
|
|
|
time_t t = (value / 10000000LL) - 719162LL*86400LL; |
|
|
|
struct tm *tm = gmtime(&t); |
|
|
|
struct tm tmbuf; |
|
|
|
struct tm *tm = gmtime_r(&t, &tmbuf); |
|
|
|
if (!tm) |
|
|
|
return -1; |
|
|
|
if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm)) |
|
|
|
@@ -416,7 +419,8 @@ static int crazytime_to_iso8601(char *buf, int buf_size, int64_t value) |
|
|
|
static int oledate_to_iso8601(char *buf, int buf_size, int64_t value) |
|
|
|
{ |
|
|
|
time_t t = (av_int2double(value) - 25569.0) * 86400; |
|
|
|
struct tm *tm= gmtime(&t); |
|
|
|
struct tm tmbuf; |
|
|
|
struct tm *tm= gmtime_r(&t, &tmbuf); |
|
|
|
if (!tm) |
|
|
|
return -1; |
|
|
|
if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm)) |
|
|
|
|