summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-08-16 10:45:37 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:48 +0200
commit112d8dd2fd8c252ce8afafd413201a50a0ace467 (patch)
treee385955dd095195ee06ba243370ec93e45e419a8 /stream
parentb7d40eab7d07bc0d2a0e31a0093d450f88837163 (diff)
downloadmpv-112d8dd2fd8c252ce8afafd413201a50a0ace467.tar.bz2
mpv-112d8dd2fd8c252ce8afafd413201a50a0ace467.tar.xz
stream_file: Simplify and document MinGW stdin hack
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31964 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_file.c7
1 files 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;