Commit 0aa088cd authored by Pierre Ynard's avatar Pierre Ynard

live555: recreate URL only to strip username/password

This restores the original logic from
c77ee763
parent bc975106
...@@ -477,29 +477,26 @@ static int Connect( demux_t *p_demux ) ...@@ -477,29 +477,26 @@ static int Connect( demux_t *p_demux )
int i_http_port = 0; int i_http_port = 0;
int i_ret = VLC_SUCCESS; int i_ret = VLC_SUCCESS;
/* Create the url using the port number if available */ /* Get the user name and password */
if( p_sys->url.i_port == 0 ) if( p_sys->url.psz_username || p_sys->url.psz_password )
{ {
/* Create the URL by stripping away the username/password part */
if( p_sys->url.i_port == 0 )
p_sys->url.i_port = 554; p_sys->url.i_port = 554;
if( asprintf( &psz_url, "rtsp://%s", p_sys->psz_path ) == -1 ) if( asprintf( &psz_url, "rtsp://%s:%d%s",
return VLC_ENOMEM; strempty( p_sys->url.psz_host ),
}
else
{
if( asprintf( &psz_url, "rtsp://%s:%d%s", p_sys->url.psz_host,
p_sys->url.i_port, p_sys->url.i_port,
strempty( p_sys->url.psz_path ) ) == -1 ) strempty( p_sys->url.psz_path ) ) == -1 )
return VLC_ENOMEM; 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_user = strdup( strempty( p_sys->url.psz_username ) );
psz_pwd = strdup( strempty( p_sys->url.psz_password ) ); psz_pwd = strdup( strempty( p_sys->url.psz_password ) );
} }
else else
{ {
if( asprintf( &psz_url, "rtsp://%s", p_sys->psz_path ) == -1 )
return VLC_ENOMEM;
psz_user = var_CreateGetString( p_demux, "rtsp-user" ); psz_user = var_CreateGetString( p_demux, "rtsp-user" );
psz_pwd = var_CreateGetString( p_demux, "rtsp-pwd" ); psz_pwd = var_CreateGetString( p_demux, "rtsp-pwd" );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment