]> git.sesse.net Git - vlc/commitdiff
Merge UDP access output with core TTL handling
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 21 Oct 2006 08:51:19 +0000 (08:51 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 21 Oct 2006 08:51:19 +0000 (08:51 +0000)
modules/access_output/udp.c
src/libvlc.h

index 9e3cdcce3cc86f12abac0b41db71de8be5630f98..94a5bc9a960c9aa476ca7316d802126e03420f3a 100644 (file)
@@ -77,12 +77,6 @@ static void Close( vlc_object_t * );
     "Default caching value for outbound UDP streams. This " \
     "value should be set in milliseconds." )
 
-#define TTL_TEXT N_("Hop limit (TTL)")
-#define TTL_LONGTEXT N_( \
-    "This is the hop limit (also known as \"Time-To-Live\" or TTL) of " \
-    "the multicast packets sent by the stream output (0 = use operating " \
-    "system built-in default).")
-
 #define GROUP_TEXT N_("Group packets")
 #define GROUP_LONGTEXT N_("Packets can be sent one by one at the right time " \
                           "or by groups. You can choose the number " \
@@ -101,8 +95,6 @@ vlc_module_begin();
     set_category( CAT_SOUT );
     set_subcategory( SUBCAT_SOUT_ACO );
     add_integer( SOUT_CFG_PREFIX "caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
-    add_integer( SOUT_CFG_PREFIX "ttl", 0, NULL,TTL_TEXT, TTL_LONGTEXT,
-                                 VLC_TRUE );
     add_integer( SOUT_CFG_PREFIX "group", 1, NULL, GROUP_TEXT, GROUP_LONGTEXT,
                                  VLC_TRUE );
     add_suppressed_integer( SOUT_CFG_PREFIX "late" );
@@ -121,12 +113,20 @@ vlc_module_end();
 
 static const char *ppsz_sout_options[] = {
     "caching",
-    "ttl",
     "group",
     "raw",
     NULL
 };
 
+/* Options handled by the libvlc network core */
+static const char *ppsz_core_options[] = {
+    "dscp",
+    "ttl",
+    "miface",
+    "miface-addr",
+    NULL
+};
+
 static int  Write   ( sout_access_out_t *, block_t * );
 static int  WriteRaw( sout_access_out_t *, block_t * );
 static int  Seek    ( sout_access_out_t *, off_t  );
@@ -185,7 +185,9 @@ static int Open( vlc_object_t *p_this )
     vlc_value_t         val;
 
     config_ChainParse( p_access, SOUT_CFG_PREFIX,
-                   ppsz_sout_options, p_access->p_cfg );
+                       ppsz_sout_options, p_access->p_cfg );
+    config_ChainParse( p_access, "",
+                       ppsz_core_options, p_access->p_cfg );
 
     if( !( p_sys = malloc( sizeof( sout_access_out_sys_t ) ) ) )
     {
@@ -247,11 +249,10 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_thread->p_fifo = block_FifoNew( p_access );
     p_sys->p_thread->p_empty_blocks = block_FifoNew( p_access );
 
-    var_Get( p_access, SOUT_CFG_PREFIX "ttl", &val );
-    i_handle = net_ConnectUDP( p_this, psz_dst_addr, i_dst_port, val.i_int );
+    i_handle = net_ConnectUDP( p_this, psz_dst_addr, i_dst_port, -1 );
     if( i_handle == -1 )
     {
-         msg_Err( p_access, "failed to open a connection (udp)" );
+         msg_Err( p_access, "failed to create UDP socket" );
          return VLC_EGENERIC;
     }
 
index 359d516a051e070f56902704e6f4866210dd77d4..fb9ee1f2ae0604bfe916da55836a3d39b2d2c85a 100644 (file)
@@ -434,7 +434,7 @@ static char *ppsz_clock_descriptions[] =
 #define TTL_TEXT N_("Hop limit (TTL)")
 #define TTL_LONGTEXT N_( \
     "This is the hop limit (also known as \"Time-To-Live\" or TTL) of " \
-    "the multicast packets sent by the stream output (0 = use operating " \
+    "the multicast packets sent by the stream output (-1 = use operating " \
     "system built-in default).")
 
 #define MIFACE_TEXT N_("Multicast output interface")
@@ -1537,7 +1537,7 @@ vlc_module_begin();
     set_subcategory( SUBCAT_SOUT_ACO );
     add_module( "access_output", "sout access", NULL, NULL,
                 ACCESS_OUTPUT_TEXT, ACCESS_OUTPUT_LONGTEXT, VLC_TRUE );
-    add_integer( "ttl", 0, NULL, TTL_TEXT, TTL_LONGTEXT, VLC_TRUE );
+    add_integer( "ttl", -1, NULL, TTL_TEXT, TTL_LONGTEXT, VLC_TRUE );
     add_string( "miface", NULL, NULL, MIFACE_TEXT, MIFACE_LONGTEXT, VLC_TRUE );
     add_string( "miface-addr", NULL, NULL, MIFACE_ADDR_TEXT, MIFACE_ADDR_LONGTEXT, VLC_TRUE );
     add_integer( "dscp", 0, NULL, DSCP_TEXT, DSCP_LONGTEXT, VLC_TRUE );