]> git.sesse.net Git - vlc/commitdiff
sap.c: Ressucitate --sap-addr for the lucky one with M-Bone and too much sap announces.
authorChristophe Mutricy <xtophe@videolan.org>
Fri, 24 Mar 2006 18:26:46 +0000 (18:26 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Fri, 24 Mar 2006 18:26:46 +0000 (18:26 +0000)
modules/services_discovery/sap.c

index 28c97a3c117099630f4d5f5b33267b8150b3be76..50297bd22cb2b4a0cc3aad2708de550c60233ca2 100644 (file)
@@ -76,6 +76,10 @@ static const char ipv6_scopes[] = "1456789ABCDE";
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
+#define SAP_ADDR_TEXT N_( "SAP multicast address" )
+#define SAP_ADDR_LONGTEXT N_( "The SAP module normally chooses itself the " \
+                              "good addresses to listen to. However, you can " \
+                              "specify a specific address" )
 #define SAP_IPV4_TEXT N_( "IPv4-SAP listening" )
 #define SAP_IPV4_LONGTEXT N_( \
       "Set this if you want the SAP module to listen to IPv4 announcements " \
@@ -121,6 +125,8 @@ vlc_module_begin();
     set_category( CAT_PLAYLIST );
     set_subcategory( SUBCAT_PLAYLIST_SD );
 
+    add_string( "sap-addr", NULL, NULL,
+                SAP_ADDR_TEXT, SAP_ADDR_LONGTEXT, VLC_TRUE );
     add_bool( "sap-ipv4", 1 , NULL,
                SAP_IPV4_TEXT,SAP_IPV4_LONGTEXT, VLC_TRUE );
     add_bool( "sap-ipv6", 1 , NULL,
@@ -135,7 +141,6 @@ vlc_module_begin();
                SAP_CACHE_TEXT,SAP_CACHE_LONGTEXT, VLC_TRUE );
     add_bool( "sap-timeshift", 0 , NULL,
               SAP_TIMESHIFT_TEXT,SAP_TIMESHIFT_LONGTEXT, VLC_TRUE );
-    add_suppressed_string( "sap-addr" );
 
     set_capability( "services_discovery", 0 );
     set_callbacks( Open, Close );
@@ -500,6 +505,12 @@ static void Run( services_discovery_t *p_sd )
         }
     }
 
+    psz_addr = var_CreateGetString( p_sd, "sap-addr" );
+    if( psz_addr && *psz_addr )
+    {
+        InitSocket( p_sd, psz_addr, SAP_PORT );
+    }
+
     if( p_sd->p_sys->i_fd == 0 )
     {
         msg_Err( p_sd, "unable to listen on any address" );