[vlc-commits] commit: live555: recreate URL only to strip username/password ( Pierre Ynard )
git at videolan.org
git at videolan.org
Sun May 9 10:21:05 CEST 2010
vlc/vlc-1.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun May 9 09:59:46 2010 +0200| [a7ec24d1ab90b33d2b8f80ae7caf7d3966f4ac69] | committer: Pierre Ynard
live555: recreate URL only to strip username/password
This restores the original logic from
c77ee7637b006df4810a548916072532467936e5
(cherry picked from commit 0aa088cde297e30c8d002767bc2d3bbb570b0f01)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=a7ec24d1ab90b33d2b8f80ae7caf7d3966f4ac69
---
modules/demux/live555.cpp | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index 9a4f56c..eca4826 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -477,29 +477,26 @@ static int Connect( demux_t *p_demux )
int i_http_port = 0;
int i_ret = VLC_SUCCESS;
- /* Create the url using the port number if available */
- if( p_sys->url.i_port == 0 )
- {
- p_sys->url.i_port = 554;
- if( asprintf( &psz_url, "rtsp://%s", p_sys->psz_path ) == -1 )
- return VLC_ENOMEM;
- }
- else
+ /* Get the user name and password */
+ if( p_sys->url.psz_username || p_sys->url.psz_password )
{
- if( asprintf( &psz_url, "rtsp://%s:%d%s", p_sys->url.psz_host,
+ /* Create the URL by stripping away the username/password part */
+ if( p_sys->url.i_port == 0 )
+ p_sys->url.i_port = 554;
+ if( asprintf( &psz_url, "rtsp://%s:%d%s",
+ strempty( p_sys->url.psz_host ),
p_sys->url.i_port,
strempty( p_sys->url.psz_path ) ) == -1 )
return VLC_ENOMEM;
- }
- /* Get the user name and password */
- if( p_sys->url.psz_username || p_sys->url.psz_password )
- {
psz_user = strdup( strempty( p_sys->url.psz_username ) );
psz_pwd = strdup( strempty( p_sys->url.psz_password ) );
}
else
{
+ if( asprintf( &psz_url, "rtsp://%s", p_sys->psz_path ) == -1 )
+ return VLC_ENOMEM;
+
psz_user = var_CreateGetString( p_demux, "rtsp-user" );
psz_pwd = var_CreateGetString( p_demux, "rtsp-pwd" );
}
More information about the vlc-commits
mailing list