From 68d505b20277032aeba9236c91ae95885758fc2a Mon Sep 17 00:00:00 2001 From: rsf Date: Tue, 8 Apr 2003 05:14:43 +0000 Subject: Moved the "sdp://" test above the URL streaming test, so that SDP files can be read without streaming error messages being printed first. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9879 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/open.c | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'libmpdemux') diff --git a/libmpdemux/open.c b/libmpdemux/open.c index 006adf6765..463d73ef99 100644 --- a/libmpdemux/open.c +++ b/libmpdemux/open.c @@ -540,6 +540,30 @@ if(strncmp("dvbin://",filename,8) == 0) } #ifdef STREAMING +#ifdef STREAMING_LIVE_DOT_COM + // Check for a SDP file: + 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 NULL; } + + len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); + if (len == -1) + return NULL; + +#ifdef _LARGEFILE_SOURCE + mp_msg(MSGT_OPEN,MSGL_V,"File size is %lld bytes\n", (long long)len); +#else + mp_msg(MSGT_OPEN,MSGL_V,"File size is %u bytes\n", (unsigned int)len); +#endif + return stream_open_sdp(f, len, file_format); + } +#endif + url = url_new(filename); if(url) { if (strcmp(url->protocol, "smb")==0){ @@ -590,32 +614,9 @@ if(strncmp("dvbin://",filename,8) == 0) return stream; } } - -//============ Open STDIN or plain FILE ============ -#ifdef STREAMING_LIVE_DOT_COM - // a SDP file: I hope the sdp protocol isn't really in use - 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 NULL; } - - len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); - if (len == -1) - return NULL; -#ifdef _LARGEFILE_SOURCE - mp_msg(MSGT_OPEN,MSGL_V,"File size is %lld bytes\n", (long long)len); -#else - mp_msg(MSGT_OPEN,MSGL_V,"File size is %u bytes\n", (unsigned int)len); -#endif - return stream_open_sdp(f, len, file_format); - } -#endif -#endif +//============ Open STDIN or plain FILE ============ return open_stream_full(filename,STREAM_READ,options,file_format); } -- cgit v1.2.3