diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2001-08-13 21:37:10 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2001-08-13 21:37:10 +0000 |
commit | 8be1c6563cd3e13896b8f3381cf6a8e200c1f53b (patch) | |
tree | 3f80373f11ddba48ee510969a2af3374e76c8b27 /libav/utils.c | |
parent | 519c2b6d1182513a83efee5b1e8634a7feaedbbf (diff) | |
download | ffmpeg-8be1c6563cd3e13896b8f3381cf6a8e200c1f53b.tar.gz |
win32 fixes
Originally committed as revision 78 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/utils.c')
-rw-r--r-- | libav/utils.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/libav/utils.c b/libav/utils.c index 33949b6fe1..b5f4697de9 100644 --- a/libav/utils.c +++ b/libav/utils.c @@ -16,16 +16,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> +#include "avformat.h" +#ifndef CONFIG_WIN32 #include <unistd.h> #include <fcntl.h> -#include <errno.h> #include <sys/time.h> #include <time.h> - -#include "avformat.h" +#else +#define strcasecmp _stricmp +#include <sys/types.h> +#include <sys/timeb.h> +#endif AVFormat *first_format; @@ -141,7 +142,9 @@ void register_all(void) register_avformat(&wav_format); register_avformat(&pcm_format); register_avformat(&rawvideo_format); +#ifndef CONFIG_WIN32 register_avformat(&ffm_format); +#endif register_avformat(&pgm_format); register_avformat(&ppm_format); register_avformat(&pgmyuv_format); @@ -152,10 +155,14 @@ void register_all(void) register_protocol(&file_protocol); register_protocol(&pipe_protocol); +#ifdef CONFIG_GRAB register_protocol(&audio_protocol); register_protocol(&video_protocol); +#endif +#ifndef CONFIG_WIN32 register_protocol(&udp_protocol); register_protocol(&http_protocol); +#endif } /* memory handling */ @@ -422,9 +429,15 @@ int parse_image_size(int *width_ptr, int *height_ptr, const char *str) INT64 gettime(void) { +#ifdef CONFIG_WIN32 + struct _timeb tb; + _ftime(&tb); + return ((INT64)tb.time * INT64_C(1000) + (INT64)tb.millitm) * INT64_C(1000); +#else struct timeval tv; gettimeofday(&tv,NULL); return (INT64)tv.tv_sec * 1000000 + tv.tv_usec; +#endif } /* syntax: [YYYY-MM-DD ][[HH:]MM:]SS[.m...] . Return the date in micro seconds since 1970 */ |