[MPlayer-dev-eng] [PATCH] Real RTSP streaming fix

Andreas Hess jaska at gmx.net
Thu Jun 19 09:11:44 CEST 2003


Hi,

I've found a 10l in the Real RTSP streaming code:
rtsp://<host>/<file>:<port> is not a valid URL, but
rtsp://<host>:<port>/<file> is.


Andreas

-------------- next part --------------
Index: libmpdemux/network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.83
diff -u -r1.83 network.c
--- libmpdemux/network.c	11 Jun 2003 16:48:07 -0000	1.83
+++ libmpdemux/network.c	19 Jun 2003 07:08:06 -0000
@@ -963,10 +963,8 @@
 	if(fd<0) return -1;
 	
 	sprintf(aport,"%d",port);
-	mrl = (char *)malloc(strlen(stream->streaming_ctrl->url->url)+1+10+1);
-	strcpy(mrl,stream->streaming_ctrl->url->url);
-	strcat(mrl,":");
-	strcat(mrl,aport);
+	mrl = malloc(sizeof(char)*(strlen(stream->streaming_ctrl->url->hostname)+strlen(stream->streaming_ctrl->url->file)+16));
+	sprintf(mrl,"rtsp://%s:%i/%s",stream->streaming_ctrl->url->hostname,port,stream->streaming_ctrl->url->file);
 	rtsp = rtsp_session_start(fd,&mrl, stream->streaming_ctrl->url->file,
 		stream->streaming_ctrl->url->hostname, port, &redirected);
 


More information about the MPlayer-dev-eng mailing list