]> git.sesse.net Git - vlc/blobdiff - modules/demux/live555.cpp
Fix variables types.
[vlc] / modules / demux / live555.cpp
index 9a4f56cdeaded482d68e654ba0480aaeeb7533f4..afa54fb22201b4ce47ebac4bb5bfb1a7bff534bd 100644 (file)
@@ -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" );
     }
@@ -516,7 +513,7 @@ createnew:
 
     if( ( p_sys->rtsp = RTSPClient::createNew( *p_sys->env,
           var_CreateGetInteger( p_demux, "verbose" ) > 1,
-          "VLC media player", i_http_port ) ) == NULL )
+          "LibVLC/"VERSION, i_http_port ) ) == NULL )
     {
         msg_Err( p_demux, "RTSPClient::createNew failed (%s)",
                  p_sys->env->getResultMsg() );