diff options
author | bertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-06-21 16:47:31 +0000 |
---|---|---|
committer | bertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-06-21 16:47:31 +0000 |
commit | 2b73c29ab6b66593ebbedbf53b56551d7fbe1262 (patch) | |
tree | e623068d95379cce0a6223a9eb93d2df77cc9105 /libmpdemux | |
parent | fd55a47f0118182fee26e563417a7be101cca148 (diff) | |
download | mpv-2b73c29ab6b66593ebbedbf53b56551d7fbe1262.tar.bz2 mpv-2b73c29ab6b66593ebbedbf53b56551d7fbe1262.tar.xz |
Patch from Andreas Hess <jaska@gmx.net>:
rtsp://<host>/<file>:<port> is not a valid URL, but
rtsp://<host>:<port>/<file> is.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10318 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/network.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/libmpdemux/network.c b/libmpdemux/network.c index b0f0b42c69..69dcfdeff4 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -948,36 +948,31 @@ realrtsp_streaming_start( stream_t *stream ) { char *mrl; int port; int redirected, temp; - char aport[10]; if( stream==NULL ) return -1; temp = 5; // counter so we don't get caught in infinite redirections (you never know) do { - redirected = 0; + redirected = 0; - fd = connect2Server( stream->streaming_ctrl->url->hostname, - port = (stream->streaming_ctrl->url->port ? stream->streaming_ctrl->url->port : 554) ); - printf("rtsp:// fd=%d\n",fd); - 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); - rtsp = rtsp_session_start(fd,&mrl, stream->streaming_ctrl->url->file, - stream->streaming_ctrl->url->hostname, port, &redirected); - - if ( redirected == 1 ) { - url_free(stream->streaming_ctrl->url); - stream->streaming_ctrl->url = url_new(mrl); - closesocket(fd); - } + fd = connect2Server( stream->streaming_ctrl->url->hostname, + port = (stream->streaming_ctrl->url->port ? stream->streaming_ctrl->url->port : 554) ); + if(fd<0) return -1; + + 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); + + if ( redirected == 1 ) { + url_free(stream->streaming_ctrl->url); + stream->streaming_ctrl->url = url_new(mrl); + closesocket(fd); + } - free(mrl); - temp--; + free(mrl); + temp--; } while( (redirected != 0) && (temp > 0) ); |