From bdc4796fae585a2316a0d201d287fd6493b838ba Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Mon, 13 Aug 2001 21:43:02 +0000 Subject: [PATCH] win32 fixes Originally committed as revision 81 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 122 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 78 insertions(+), 44 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 6e7822362d..9f97111f79 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -18,20 +18,25 @@ */ #include #include +#include +#include +#ifndef CONFIG_WIN32 +#include "config.h" #include #include #include -#include #include -#include #include #include #include #include #include +#endif #include "avformat.h" +#define MAXINT64 INT64_C(0x7fffffffffffffff) + typedef struct { const char *name; int flags; @@ -135,6 +140,8 @@ typedef struct AVInputFile { buffering */ } AVInputFile; +#ifndef CONFIG_WIN32 + /* init terminal so that we can grab keys */ static struct termios oldtty; @@ -593,6 +600,8 @@ int av_grab(AVFormatContext *s) goto fail1; } +#endif /* CONFIG_WIN32 */ + int read_ffserver_streams(AVFormatContext *s, const char *filename) { int i; @@ -892,13 +901,17 @@ static int av_encode(AVFormatContext **output_files, int nb_input_files, AVStreamMap *stream_maps, int nb_stream_maps) { - int ret, i, j, k, n, nb_istreams, nb_ostreams = 0; + int ret, i, j, k, n, nb_istreams = 0, nb_ostreams = 0; AVFormatContext *is, *os; AVCodecContext *codec, *icodec; AVOutputStream *ost, **ost_table = NULL; AVInputStream *ist, **ist_table = NULL; INT64 min_pts, start_time; - AVInputFile file_table[nb_input_files]; + AVInputFile *file_table; + + file_table= (AVInputFile*) malloc(nb_input_files * sizeof(AVInputFile)); + if (!file_table) + goto fail; memset(file_table, 0, sizeof(file_table)); @@ -913,7 +926,7 @@ static int av_encode(AVFormatContext **output_files, ist_table = av_mallocz(nb_istreams * sizeof(AVInputStream *)); if (!ist_table) - return -ENOMEM; + goto fail; for(i=0;idiscard && !file_table[ist->file_index].eof_reached && ist->pts < min_pts) { @@ -1310,7 +1323,7 @@ static int av_encode(AVFormatContext **output_files, total_size = url_ftell(&oc->pb); buf[0] = '\0'; - ti = (1ULL << 63) - 1; + ti = MAXINT64; vid = 0; for(i=0;ipb); buf[0] = '\0'; - ti = (1ULL << 63) - 1; + ti = MAXINT64; vid = 0; for(i=0;i