Commit 50697ac5 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '851ace79'

* commit '851ace79':
  wtv: Avoid needlessly calling gmtime twice with the same argument

Conflicts:
	libavformat/wtvdec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 90bf1e30 851ace79
...@@ -389,7 +389,7 @@ static int filetime_to_iso8601(char *buf, int buf_size, int64_t value) ...@@ -389,7 +389,7 @@ static int filetime_to_iso8601(char *buf, int buf_size, int64_t value)
struct tm *tm = gmtime(&t); struct tm *tm = gmtime(&t);
if (!tm) if (!tm)
return -1; return -1;
strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t)); strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
return 0; return 0;
} }
...@@ -403,7 +403,7 @@ static int crazytime_to_iso8601(char *buf, int buf_size, int64_t value) ...@@ -403,7 +403,7 @@ static int crazytime_to_iso8601(char *buf, int buf_size, int64_t value)
struct tm *tm = gmtime(&t); struct tm *tm = gmtime(&t);
if (!tm) if (!tm)
return -1; return -1;
strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t)); strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
return 0; return 0;
} }
...@@ -414,10 +414,10 @@ static int crazytime_to_iso8601(char *buf, int buf_size, int64_t value) ...@@ -414,10 +414,10 @@ 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) static int oledate_to_iso8601(char *buf, int buf_size, int64_t value)
{ {
time_t t = (av_int2double(value) - 25569.0) * 86400; time_t t = (av_int2double(value) - 25569.0) * 86400;
struct tm *result= gmtime(&t); struct tm *tm= gmtime(&t);
if (!result) if (!tm)
return -1; return -1;
strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", result); strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment