[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.92,1.93
Roberto Togni CVS
syncmail at mplayerhq.hu
Wed Apr 14 22:45:28 CEST 2004
CVS change done by Roberto Togni CVS
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv10509
Modified Files:
network.c
Log Message:
Try Real rtsp, then live.com on every rtsp stream (remove extension
based selection)
Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- network.c 12 Apr 2004 14:19:12 -0000 1.92
+++ network.c 14 Apr 2004 20:45:25 -0000 1.93
@@ -685,25 +685,10 @@
// Checking for RTSP
if( !strcasecmp(url->protocol, "rtsp") ) {
- // Checking for Real rtsp://
- // Extension based detection, should be replaced with something based on server answer
- if( url->file!= NULL ) {
- char *p;
- for( p = url->file; p[0]; p++ ) {
- if( p[0] == '.' && tolower(p[1]) == 'r' && (tolower(p[2]) == 'm' || tolower(p[2]) == 'a') && (!p[3] || p[3] == '?' || p[3] == '&') ) {
- *file_format = DEMUXER_TYPE_REAL;
- return 0;
- }
- }
- }
- mp_msg(MSGT_NETWORK,MSGL_INFO,"Not a Realmedia rtsp url. Trying standard rtsp protocol.\n");
-#ifdef STREAMING_LIVE_DOT_COM
- *file_format = DEMUXER_TYPE_RTP;
+ // Try Real rtsp:// first (it's always built in)
+ // If it fails, try live.com (if compiled in)
+ *file_format = DEMUXER_TYPE_REAL;
return 0;
-#else
- mp_msg(MSGT_NETWORK,MSGL_ERR,"RTSP support requires the \"LIVE.COM Streaming Media\" libraries!\n");
- return -1;
-#endif
// Checking for SIP
} else if( !strcasecmp(url->protocol, "sip") ) {
#ifdef STREAMING_LIVE_DOT_COM
@@ -1217,10 +1202,20 @@
if( (!strcasecmp( stream->streaming_ctrl->url->protocol, "rtsp")) &&
(*demuxer_type == DEMUXER_TYPE_REAL)) {
stream->fd = -1;
- ret = realrtsp_streaming_start( stream );
+ if ((ret = realrtsp_streaming_start( stream )) < 0) {
+ mp_msg(MSGT_NETWORK,MSGL_INFO,"Not a Realmedia rtsp url. Trying standard rtsp protocol.\n");
+#ifdef STREAMING_LIVE_DOT_COM
+ *demuxer_type = DEMUXER_TYPE_RTP;
+ goto try_livedotcom;
+#else
+ mp_msg(MSGT_NETWORK,MSGL_ERR,"RTSP support requires the \"LIVE.COM Streaming Media\" libraries!\n");
+ return -1;
+#endif
+ }
} else
// For connection-oriented streams, we can usually determine the streaming type.
+try_livedotcom:
switch( *demuxer_type ) {
case DEMUXER_TYPE_ASF:
// Send the appropriate HTTP request
More information about the MPlayer-cvslog
mailing list