]> git.sesse.net Git - vlc/commitdiff
Use net_ListenUDP1 and net_ConnectUDP when possible
authorRémi Denis-Courmont <rem@videolan.org>
Thu, 23 Nov 2006 11:12:49 +0000 (11:12 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 23 Nov 2006 11:12:49 +0000 (11:12 +0000)
src/network/udp.c

index 62c34f83205d1c825bcfba8e3dd629e5ba1895c6..722e15c18b5e3d73496798b8c8351ef79ba41585 100644 (file)
@@ -207,7 +207,7 @@ int net_Subscribe (vlc_object_t *obj, int fd, const struct sockaddr *addr,
             memcpy (&imr.imr_multiaddr, &v4->sin_addr, 4);
 
             /* FIXME: should use a different option for in and out */
-            char *iif = config_GetPsz (obj, "miface-addr");
+            char *iif = var_CreateGetString (obj, "miface-addr");
             if (iif != NULL)
             {
                 if ((iif[0] != '\0') &&
@@ -420,16 +420,20 @@ int __net_OpenUDP( vlc_object_t *p_this, const char *psz_bind, int i_bind,
     module_t         *p_network = NULL;
 
     if (((psz_bind == NULL) || (psz_bind[0] == '\0')) && (i_bind == 0))
+    {
         msg_Warn (p_this,
                   "Obsolete net_OpenUDP with no local endpoint; "
                   "Use net_ConnectUDP instead");
+        return net_ConnectUDP (p_this, psz_server, i_server, -1);
+    }
 
-#if 0
     if (((psz_server == NULL) || (psz_server[0] == '\0')) && (i_server == 0))
+    {
         msg_Warn (p_this,
                   "Obsolete net_OpenUDP with no remote endpoint; "
                   "Use net_ListenUDP instead");
-#endif
+        return net_ListenUDP1 (p_this, psz_bind, i_bind);
+    }
 
     if( psz_server == NULL ) psz_server = "";
     if( psz_bind == NULL ) psz_bind = "";