Mercurial > mplayer.hg
comparison stream/stream_file.c @ 31883:b14ca9b6b6d4
Simplify and document MinGW stdin hack.
author | reimar |
---|---|
date | Mon, 16 Aug 2010 10:45:37 +0000 |
parents | ce19feeb5cbb |
children | 0624fa95a2aa |
comparison
equal
deleted
inserted
replaced
31882:ef30e1505969 | 31883:b14ca9b6b6d4 |
---|---|
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); | 169 len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); |
170 #ifdef __MINGW32__ | 170 #ifdef __MINGW32__ |
171 if(f==0 || len == -1) { | 171 // seeks on stdin incorrectly succeed on MinGW |
172 #else | 172 if(f==0) |
173 len = -1; | |
174 #endif | |
173 if(len == -1) { | 175 if(len == -1) { |
174 #endif | |
175 if(mode == STREAM_READ) stream->seek = seek_forward; | 176 if(mode == STREAM_READ) stream->seek = seek_forward; |
176 stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE | 177 stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE |
177 stream->flags |= MP_STREAM_SEEK_FW; | 178 stream->flags |= MP_STREAM_SEEK_FW; |
178 } else if(len >= 0) { | 179 } else if(len >= 0) { |
179 stream->seek = seek; | 180 stream->seek = seek; |