]> git.sesse.net Git - vlc/commitdiff
Export and use ListenUDP
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 5 Nov 2006 20:02:08 +0000 (20:02 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 5 Nov 2006 20:02:08 +0000 (20:02 +0000)
include/network.h
include/vlc_symbols.h
modules/access/mms/mmstu.c
modules/control/netsync.c
modules/stream_out/switcher.c
src/stream_output/sap.c

index c45dc8e77715a353dc7c649592f00ef55e49f443..61b494bdb3c1ecf1caa7a796cd590fcdb1143d30 100644 (file)
@@ -101,7 +101,7 @@ VLC_EXPORT( int, __net_Accept, ( vlc_object_t *, int *, mtime_t ) );
 #define net_ConnectUDP(a, b, c, d ) __net_ConnectUDP(VLC_OBJECT(a), b, c, d)
 VLC_EXPORT( int, __net_ConnectUDP, ( vlc_object_t *p_this, const char *psz_host, int i_port, int hlim ) );
 
-int net_ListenUDP1 (vlc_object_t *obj, const char *host, int port);
+VLC_EXPORT( int, net_ListenUDP1, (vlc_object_t *obj, const char *host, int port) );
 
 #define net_OpenUDP(a, b, c, d, e ) __net_OpenUDP(VLC_OBJECT(a), b, c, d, e)
 VLC_EXPORT( int, __net_OpenUDP, ( vlc_object_t *p_this, const char *psz_bind, int i_bind, const char *psz_server, int i_server ) );
index 87175350ba777b749fe80e24e81df4fce27437e7..ff2c6965797cf4161797f5f0161e9f8f573e6e7d 100644 (file)
@@ -554,6 +554,7 @@ struct module_symbols_t
     void (*config_ChainDestroy_inner) (config_chain_t *);
     char * (*config_ChainCreate_inner) (char **, config_chain_t **, char *);
     int (*utf8_open_inner) (const char *filename, int flags, mode_t mode);
+    int (*net_ListenUDP1_inner) (vlc_object_t *obj, const char *host, int port);
 };
 # if defined (__PLUGIN__)
 #  define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
@@ -1031,6 +1032,7 @@ struct module_symbols_t
 #  define config_ChainDestroy (p_symbols)->config_ChainDestroy_inner
 #  define config_ChainCreate (p_symbols)->config_ChainCreate_inner
 #  define utf8_open (p_symbols)->utf8_open_inner
+#  define net_ListenUDP1 (p_symbols)->net_ListenUDP1_inner
 # elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
 /******************************************************************
  * STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
@@ -1511,6 +1513,7 @@ struct module_symbols_t
     ((p_symbols)->config_ChainDestroy_inner) = config_ChainDestroy; \
     ((p_symbols)->config_ChainCreate_inner) = config_ChainCreate; \
     ((p_symbols)->utf8_open_inner) = utf8_open; \
+    ((p_symbols)->net_ListenUDP1_inner) = net_ListenUDP1; \
     (p_symbols)->net_ConvertIPv4_deprecated = NULL; \
     (p_symbols)->__sout_CfgParse_deprecated = NULL; \
     (p_symbols)->sout_CfgCreate_deprecated = NULL; \
index d0b98791218f2731d0f12e926ca5a7842fec7434..4885460c447956080f74b891ac53a18a714ca788 100644 (file)
@@ -480,8 +480,8 @@ static int MMSOpen( access_t  *p_access, vlc_url_t *p_url, int  i_proto )
             return VLC_EGENERIC;
         }
 
-        p_sys->i_handle_udp = net_OpenUDP( p_access, p_sys->sz_bind_addr,
-                                           7000, "", 0 );
+        p_sys->i_handle_udp = net_ListenUDP1( p_access, p_sys->sz_bind_addr,
+                                              7000 );
         if( p_sys->i_handle_udp < 0 )
         {
             msg_Err( p_access, "failed to open a connection (udp)" );
index fbe56124f25e8bc2351717a81ea10b64aec4d783..a6654fd5dcfeaaec15f07821a1b10cca9c8be73f 100644 (file)
@@ -144,7 +144,7 @@ static void Run( intf_thread_t *p_intf )
     }
 
     if( b_master )
-        i_socket = net_OpenUDP( p_intf, NULL, NETSYNC_PORT, NULL, 0 );
+        i_socket = net_ListenUDP1( p_intf, NULL, NETSYNC_PORT );
     else
         i_socket = net_ConnectUDP( p_intf, psz_master, NETSYNC_PORT, 0 );
 
index bc1b315e8f36c8a58c8a579431b38f7582c5420b..dbcec41d07f34541d239b938b2edad7d7b9de5eb 100644 (file)
@@ -257,7 +257,7 @@ static int Open( vlc_object_t *p_this )
     }
 
     var_Get( p_stream, SOUT_CFG_PREFIX "port", &val );
-    p_sys->i_fd = net_OpenUDP( p_stream, NULL, val.i_int, NULL, 0 );
+    p_sys->i_fd = net_ListenUDP1( p_stream, NULL, val.i_int );
     if ( p_sys->i_fd < 0 )
     {
         free( p_sys );
index 1589e0d3949c1386d512b0d480c80b7e0435745b..a6ce5c2d44ed7cdc449a784f7ac35e9f1051f723 100644 (file)
@@ -398,7 +398,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
 
         if( p_sap->b_control == VLC_TRUE )
         {
-            p_address->i_rfd = net_OpenUDP( p_sap, psz_addr, SAP_PORT, "", 0 );
+            p_address->i_rfd = net_ListenUDP1( p_sap, psz_addr, SAP_PORT );
             if( p_address->i_rfd != -1 )
                 net_StopSend( p_address->i_rfd );
             p_address->i_buff = 0;