wtv: calculate ole date correctly (is seconds since 1899-12-30)
authorPeter Ross <pross@xvid.org>
Sun, 8 May 2011 18:14:47 +0000 (20:14 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 May 2011 00:25:40 +0000 (02:25 +0200)
libavformat/wtvdec.c

index 19d5b54..640a6f1 100644 (file)
@@ -402,7 +402,7 @@ static void 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 = 631112400LL + 86400*av_int2dbl(value);
+    time_t t = (av_int2dbl(value) - 25569.0) * 86400;
     struct tm result;
     if (!gmtime_r(&t, &result))
         return -1;