# HG changeset patch # User faust3 # Date 1091272127 0 # Node ID 1e42749917c8fa1e5129ed286ed1d8529368dd09 # Parent fa02d0766f467883e7998224b91df414eda85d53 mingw stdin fixes diff -r fa02d0766f46 -r 1e42749917c8 libmpdemux/stream_file.c --- a/libmpdemux/stream_file.c Fri Jul 30 20:19:23 2004 +0000 +++ b/libmpdemux/stream_file.c Sat Jul 31 11:08:47 2004 +0000 @@ -96,9 +96,15 @@ // 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 @@ } 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;