From 112d8dd2fd8c252ce8afafd413201a50a0ace467 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 16 Aug 2010 10:45:37 +0000 Subject: stream_file: Simplify and document MinGW stdin hack git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31964 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stream/stream_file.c b/stream/stream_file.c index 1f46a01f41..f506a0f644 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -167,10 +167,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) { + // seeks on stdin incorrectly succeed on MinGW + if(f==0) + len = -1; #endif + if(len == -1) { if(mode == STREAM_READ) stream->seek = seek_forward; stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE stream->flags |= MP_STREAM_SEEK_FW; -- cgit v1.2.3