MinGW has gettimeofday() since mingw-runtime-3.10
authorRamiro Polla <ramiro.polla@gmail.com>
Mon, 16 Jul 2007 20:27:16 +0000 (20:27 +0000)
committerRamiro Polla <ramiro.polla@gmail.com>
Mon, 16 Jul 2007 20:27:16 +0000 (20:27 +0000)
Originally committed as revision 9705 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/os_support.c

index 947679a1439d83e21080885b33bd961cf215a0df..23fc922e8444096d802fb23456d2d7f89e57f522 100644 (file)
  */
 #include "config.h"
 #include "avformat.h"
-#if defined(__MINGW32__)
-#include <sys/types.h>
-#include <sys/timeb.h>
-#else
+#if !defined(__MINGW32__)
 #include <unistd.h>
 #include <fcntl.h>
-#include <sys/time.h>
 #endif
+#include <sys/time.h>
 #include <time.h>
 
 #ifndef HAVE_SYS_POLL_H
  */
 int64_t av_gettime(void)
 {
-#if defined(__MINGW32__)
-    struct timeb tb;
-    _ftime(&tb);
-    return ((int64_t)tb.time * INT64_C(1000) + (int64_t)tb.millitm) * INT64_C(1000);
-#else
     struct timeval tv;
     gettimeofday(&tv,NULL);
     return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
-#endif
 }
 
 #ifdef CONFIG_NETWORK