1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

Merge commit '82ee7d0dda0fec8cdb670f4e844bf5c2927ad9de'

* commit '82ee7d0dda0fec8cdb670f4e844bf5c2927ad9de':
  Use gmtime_r instead of gmtime and localtime_r instead of localtime

Conflicts:
	libavformat/mov.c
	libavformat/mxfenc.c
	libavformat/wtvdec.c
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-10-26 02:38:26 +01:00
4 changed files with 16 additions and 8 deletions

View File

@@ -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))