summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrsf <rsf@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-08 05:14:43 +0000
committerrsf <rsf@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-08 05:14:43 +0000
commit68d505b20277032aeba9236c91ae95885758fc2a (patch)
tree7b5b982db9543968ef56a02711ff204377980233 /libmpdemux
parent3ffbf1834c127e1e096b0aaec8b12577a9ae8210 (diff)
downloadmpv-68d505b20277032aeba9236c91ae95885758fc2a.tar.bz2
mpv-68d505b20277032aeba9236c91ae95885758fc2a.tar.xz
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
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/open.c49
1 files changed, 25 insertions, 24 deletions
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);
}