[Mplayer-cvslog] CVS: main/libmpdemux open.c,1.76,1.77

Ross Finlayson CVS rsf at mplayerhq.hu
Tue Apr 8 07:15:06 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv30677

Modified Files:
	open.c 
Log Message:
Moved the "sdp://" test above the URL streaming test, so that SDP files can
be read without streaming error messages being printed first.


Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- open.c	2 Apr 2003 19:29:26 -0000	1.76
+++ open.c	8 Apr 2003 05:14:43 -0000	1.77
@@ -540,6 +540,30 @@
   }
   
 #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 @@
 	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);
 }



More information about the MPlayer-cvslog mailing list