From 6632c021c02784ae31682fcca87669370037ae94 Mon Sep 17 00:00:00 2001 From: faust3 Date: Sat, 31 Jul 2004 11:08:47 +0000 Subject: mingw stdin fixes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12922 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/stream_file.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libmpdemux') diff --git a/libmpdemux/stream_file.c b/libmpdemux/stream_file.c index 974171ecc2..05197c2480 100644 --- a/libmpdemux/stream_file.c +++ b/libmpdemux/stream_file.c @@ -96,9 +96,15 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { // read from stdin mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN); f=0; // 0=stdin +#ifdef __MINGW32__ + setmode(fileno(stdin),O_BINARY); +#endif } else { mp_msg(MSGT_OPEN,MSGL_INFO,"Writing to stdout\n"); f=1; +#ifdef __MINGW32__ + setmode(fileno(stdout),O_BINARY); +#endif } } else { f=open(p->filename,m); @@ -110,7 +116,11 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { } len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); +#ifdef __MINGW32__ + if(f==0 || len == -1) { +#else if(len == -1) { +#endif stream->seek = seek_forward; stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE stream->flags |= STREAM_SEEK_FW; -- cgit v1.2.3