]> granicus.if.org Git - libx264/commitdiff
Fix fps reporting on mingw64
authorSteven Walters <kemuri9@gmail.com>
Sat, 30 Oct 2010 20:51:01 +0000 (16:51 -0400)
committerFiona Glaser <fiona@x264.com>
Sun, 31 Oct 2010 18:26:48 +0000 (11:26 -0700)
_ftime on mingw64 uses __timeb32 which is broken.
Use ftime instead.

common/mdate.c

index aaba97acc51d6c65e3275dc48afe4593266b3fa8..702d44743f4b3ed2bee37411d567e7bb8c04ef59 100644 (file)
@@ -39,11 +39,11 @@ int64_t x264_mdate( void )
 #ifndef __MINGW32__
     struct timeval tv_date;
     gettimeofday( &tv_date, NULL );
-    return( (int64_t) tv_date.tv_sec * 1000000 + (int64_t) tv_date.tv_usec );
+    return (int64_t)tv_date.tv_sec * 1000000 + (int64_t)tv_date.tv_usec;
 #else
-    struct _timeb tb;
-    _ftime(&tb);
-    return ((int64_t)tb.time * (1000) + (int64_t)tb.millitm) * (1000);
+    struct timeb tb;
+    ftime( &tb );
+    return ((int64_t)tb.time * 1000 + (int64_t)tb.millitm) * 1000;
 #endif
 }