[MPlayer-dev-eng] Question about real media rtsp redirect

Martin Simmons vyslnqaaxytp at spammotel.com
Sun Jul 25 01:16:29 CEST 2004


>>>>> On Fri, 23 Jul 2004 02:54:16 +0000 (UTC), adland <adland123 at yahoo.com> said:

  adland> I tried the following mplayer example based on a user list messsage.

  adland> mplayer -playlist 
  adland> "http://click.real.com/?clipid=50031&pageid=movies.pachinko.stories"

  adland> after a few urls were fetched/parsed the final url caused a redirect
  adland> librtsp: server responds: 'REDIRECT
  adland> rtsp://go.rbn.com:554/realone/hollywood/demand/trailers/44310_300.rm?title=
  adland> Real%20Movies&amp;author=RealNetworks RTSP/1.0'
  adland> rtsp_session: redirected to 
  adland> rtsp://rx-lvl3-tex19.rbn.com/farm/*/realone/hollywood/demand/trailers/
  adland> 44310_300.rm?title=Real Movies&amp;author=RealNetworks

  adland> which failed with
  adland> MPlayer interrupted by signal 11 in module: open_stream

  adland> traced issue to the line I commented in patch below.
  adland> Unsure what the reason was for this issue with the line I commented however.

  adland> which is part of libmpdemux/url.c/url_free called from in libmpdemux/network.c
  adland> realrtsp_streaming_start( stream_t *stream ) {
  adland> ...
  adland>         if ( redirected == 1 ) {                        
  adland> url_free(stream->streaming_ctrl->url);


  adland> --- main/libmpdemux/url.c       2004-06-25 14:51:13.000000000 -0400
  adland> +++ updated/libmpdemux/url.c    2004-07-22 22:07:14.000000000 -0400
  adland> @@ -213,7 +213,7 @@
  adland>         if(url->url) free(url->url);
  adland>         if(url->protocol) free(url->protocol);
  adland>         if(url->hostname) free(url->hostname);
  adland>       if(url->file) free(url->file);
  adland> +//     if(url->file) free(url->file);
  adland>         if(url->username) free(url->username);
  adland>         if(url->password) free(url->password);
  adland>         free(url);

The reason for the crash is that url->file has been corrupted by the change in
revision 1.103 of libmpdemux/network.c.

The patch below fixes it for me (note this is relative to revision 1.103
because I'm running from an old snapshot, but the patch will apply to revision
1.104 too):

--- libmpdemux/network.c	26 Jun 2004 10:40:15 -0000	1.103
+++ libmpdemux/network.c	24 Jul 2004 23:10:47 -0000
@@ -1029,6 +1029,7 @@
 	int fd;
 	rtsp_session_t *rtsp;
 	char *mrl;
+	char *file;
 	int port;
 	int redirected, temp;
 	if( stream==NULL ) return -1;
@@ -1043,11 +1044,12 @@
 			port = (stream->streaming_ctrl->url->port ? stream->streaming_ctrl->url->port : 554),1 );
 		if(fd<0) return -1;
 		
-		mrl = malloc(sizeof(char)*(strlen(stream->streaming_ctrl->url->hostname)+strlen(stream->streaming_ctrl->url->file)+16));
-		if (stream->streaming_ctrl->url->file[0] == '/')
-		    stream->streaming_ctrl->url->file++;
-		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,
+		file = stream->streaming_ctrl->url->file;
+		if (file[0] == '/')
+		    file++;
+		mrl = malloc(sizeof(char)*(strlen(stream->streaming_ctrl->url->hostname)+strlen(file)+16));
+		sprintf(mrl,"rtsp://%s:%i/%s",stream->streaming_ctrl->url->hostname,port,file);
+		rtsp = rtsp_session_start(fd,&mrl, file,
 			stream->streaming_ctrl->url->hostname, port, &redirected);
 
 		if ( redirected == 1 ) {

__Martin




More information about the MPlayer-dev-eng mailing list