[FFmpeg-cvslog] wtv: Avoid needlessly calling gmtime twice with the same argument

Martin Storsjö git at videolan.org
Sun Oct 26 02:00:17 CET 2014


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Oct 24 10:36:54 2014 +0300| [851ace79a307bea54b44bd6f7ecd3b7861c28ec6] | committer: Martin Storsjö

wtv: Avoid needlessly calling gmtime twice with the same argument

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=851ace79a307bea54b44bd6f7ecd3b7861c28ec6
---

 libavformat/wtv.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index ce0122d..fa864e8 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -430,7 +430,7 @@ static void filetime_to_iso8601(char *buf, int buf_size, int64_t value)
     time_t t = (value / 10000000LL) - 11644473600LL;
     struct tm *tm = gmtime(&t);
     if (tm)
-        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
+        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
     else
         buf[0] = '\0';
 }
@@ -443,7 +443,7 @@ static void crazytime_to_iso8601(char *buf, int buf_size, int64_t value)
     time_t t = (value / 10000000LL) - 719162LL*86400LL;
     struct tm *tm = gmtime(&t);
     if (tm)
-        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
+        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
     else
         buf[0] = '\0';
 }
@@ -456,7 +456,7 @@ static void oledate_to_iso8601(char *buf, int buf_size, int64_t value)
     time_t t = 631112400LL + 86400*av_int2double(value);
     struct tm *tm = gmtime(&t);
     if (tm)
-        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t));
+        strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
     else
         buf[0] = '\0';
 }



More information about the ffmpeg-cvslog mailing list