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
This commit is contained in:
rsf 2003-04-08 05:14:43 +00:00
parent 3ffbf1834c
commit 68d505b202
1 changed files with 25 additions and 24 deletions

View File

@ -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;
}
}
#endif
//============ 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
return open_stream_full(filename,STREAM_READ,options,file_format);
}