aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-31 11:08:47 +0000
committerGravatar faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-07-31 11:08:47 +0000
commit6632c021c02784ae31682fcca87669370037ae94 (patch)
tree8d6be67afdf88bae39a69af9531f8cc2c099e1fc /libmpdemux
parentf4a8670d96e90fc24749ff2a88173cd16f1f945b (diff)
mingw stdin fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12922 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/stream_file.c10
1 files changed, 10 insertions, 0 deletions
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;