+ psz_url = (char*)malloc( strlen( p_sys->psz_path ) + 8 );
+ if( !psz_url ) return VLC_ENOMEM;
+
+ if( p_sys->url.psz_username || p_sys->url.psz_password )
+ {
+ sprintf( psz_url, "rtsp://%s%s", p_sys->url.psz_host,
+ p_sys->url.psz_path );
+
+ psz_user = strdup( p_sys->url.psz_username );
+ psz_pwd = strdup( p_sys->url.psz_password );
+ }
+ else
+ {
+ sprintf( psz_url, "rtsp://%s", p_sys->psz_path );
+
+ psz_user = var_CreateGetString( p_demux, "rtsp-user" );
+ psz_pwd = var_CreateGetString( p_demux, "rtsp-pwd" );
+ }
+