From dd491c0d289bb00b2d05fb75e11b52f5a9584f26 Mon Sep 17 00:00:00 2001 From: komh Date: Sat, 6 Mar 2010 07:24:41 +0000 Subject: Define O_BINARY in stream/stream.h unless it is defined yet, and use it in other places. This removes platform specific checks and prevents repeated definitions of O_BINARY. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30850 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream.h | 5 +++++ stream/stream_cddb.c | 4 ---- stream/stream_file.c | 2 -- stream/stream_live555.c | 4 ---- 4 files changed, 5 insertions(+), 10 deletions(-) (limited to 'stream') diff --git a/stream/stream.h b/stream/stream.h index 7774651611..2810839959 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -25,6 +25,11 @@ #include #include #include +#include + +#ifndef O_BINARY +#define O_BINARY 0 +#endif #define STREAMTYPE_DUMMY -1 // for placeholders, when the actual reading is handled in the demuxer #define STREAMTYPE_FILE 0 // read from seekable file diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c index 47a0321e01..a679a9898c 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -76,10 +76,6 @@ #include "network.h" #include "libavutil/common.h" -#ifndef O_BINARY -#define O_BINARY 0 -#endif - #define DEFAULT_FREEDB_SERVER "freedb.freedb.org" #define DEFAULT_CACHE_DIR "/.cddb/" diff --git a/stream/stream_file.c b/stream/stream_file.c index 9fda32b185..37bbee4cfb 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -136,9 +136,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { filename++; #endif -#if defined(__CYGWIN__)|| defined(__MINGW32__) || defined(__OS2__) m |= O_BINARY; -#endif if(!strcmp(filename,"-")){ if(mode == STREAM_READ) { diff --git a/stream/stream_live555.c b/stream/stream_live555.c index 37bc3be495..813977847e 100644 --- a/stream/stream_live555.c +++ b/stream/stream_live555.c @@ -79,11 +79,7 @@ static int open_live_sdp(stream_t *stream,int mode, void* opts, int* file_format if(strncmp("sdp://",filename,6) == 0) { filename += 6; -#if defined(__CYGWIN__) || defined(__MINGW32__) f = open(filename,O_RDONLY|O_BINARY); -#else - f = open(filename,O_RDONLY); -#endif if(f < 0) { mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename); return STREAM_ERROR; -- cgit v1.2.3