diff -Naur ffmpeg.old/libavformat/os_support.c ffmpeg.new/libavformat/os_support.c --- ffmpeg.old/libavformat/os_support.c 2008-11-05 14:56:46.000000000 -0600 +++ ffmpeg.new/libavformat/os_support.c 2008-11-05 15:20:45.000000000 -0600 @@ -30,6 +30,10 @@ #include #include "os_support.h" +#ifdef __MINGW32__ +#include +#endif + #ifdef CONFIG_NETWORK #ifndef HAVE_POLL_H #ifdef HAVE_WINSOCK2_H diff -Naur ffmpeg.old/libavformat/os_support.h ffmpeg.new/libavformat/os_support.h --- ffmpeg.old/libavformat/os_support.h 2008-11-05 14:56:46.000000000 -0600 +++ ffmpeg.new/libavformat/os_support.h 2008-11-05 15:20:33.000000000 -0600 @@ -30,6 +30,7 @@ #ifdef __MINGW32__ # include # define lseek(f,p,w) _lseeki64((f), (p), (w)) +# define usleep(t) Sleep((t) / 1000) #endif static inline int is_dos_path(const char *path) diff -Naur ffmpeg.old/libavformat/udp.c ffmpeg.new/libavformat/udp.c --- ffmpeg.old/libavformat/udp.c 2008-11-05 14:56:46.000000000 -0600 +++ ffmpeg.new/libavformat/udp.c 2008-11-05 15:01:41.000000000 -0600 @@ -402,6 +402,11 @@ getsockname(udp_fd, (struct sockaddr *)&my_addr, &len); s->local_port = udp_port(&my_addr, len); +#ifdef __MINGW32__ + len = 65536; /* 64k UDP buffer size. Should this be bigger? */ + setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &len, sizeof(len)); +#endif + if (s->is_multicast) { if (h->flags & URL_WRONLY) { /* output */ diff -Naur ffmpeg.old/libavformat/utils.c ffmpeg.new/libavformat/utils.c --- ffmpeg.old/libavformat/utils.c 2008-11-05 14:56:47.000000000 -0600 +++ ffmpeg.new/libavformat/utils.c 2008-11-05 15:21:24.000000000 -0600 @@ -35,6 +35,21 @@ * various utility functions for use within FFmpeg */ +#ifdef __MINGW32__ +#include + +int gettimeofday(struct timeval *tp, void *tzp) +{ + struct _timeb timebuffer; + + _ftime(&timebuffer); + tp->tv_sec = timebuffer.time; + tp->tv_usec = timebuffer.millitm * 1000; + + return 0; +} +#endif + unsigned avformat_version(void) { return LIBAVFORMAT_VERSION_INT;