"When the SAP flow control is disabled, " \
"this lets you set the fixed interval between SAP announcements." )
-#define ANN_SAP_SFILTER_TEXT N_("Use SAP source filter")
-#define ANN_SAP_SFILTER_LONGTEXT N_( \
- "When this is disabled, SAP announcements do not include a " \
- "source-filter parameter and source-specific multicast is not used.")
-
/*****************************************************************************
* Advanced
****************************************************************************/
ANN_SAPCTRL_LONGTEXT, VLC_TRUE );
add_integer( "sap-interval", 5, NULL, ANN_SAPINTV_TEXT,
ANN_SAPINTV_LONGTEXT, VLC_TRUE );
- add_bool( "sap-source-filter", VLC_TRUE, NULL, ANN_SAP_SFILTER_TEXT,
- ANN_SAP_SFILTER_LONGTEXT, VLC_TRUE );
+
set_subcategory( SUBCAT_SOUT_VOD );
/* CPU options */
static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address );
static char *SDPGenerate( sap_handler_t *p_sap,
const session_descriptor_t *p_session,
- const sap_address_t *p_addr );
+ const sap_address_t *p_addr, vlc_bool_t b_ssm );
static int announce_SendSAPAnnounce( sap_handler_t *p_sap,
sap_session_t *p_session );
{
int i_header_size, i;
char *psz_head, psz_addr[NI_MAXNUMERICHOST];
- vlc_bool_t b_ipv6 = VLC_FALSE;
+ vlc_bool_t b_ipv6 = VLC_FALSE, b_ssm = VLC_FALSE;
sap_session_t *p_sap_session;
mtime_t i_hash;
struct addrinfo hints, *res;
memcpy( a6->s6_addr + 2, "\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x02\x7f\xfe", 14 );
if( IN6_IS_ADDR_MULTICAST( a6 ) )
- /* force flags to zero, preserve scope */
+ {
+ /* force flags to zero, preserve scope */
a6->s6_addr[1] &= 0xf;
+
+ /* SSM <=> ff3x::/32 */
+ b_ssm = (GetDWLE (a6->s6_addr) & 0xfff0ffff) == 0xff300000;
+ }
else
/* Unicast IPv6 - assume global scope */
memcpy( a6->s6_addr, "\xff\x0e", 2 );
ipv4 = 0;
else
/* other addresses => 224.2.127.254 */
+ {
ipv4 = 0xe0027ffe;
+ /* SSM: 232.0.0.0/8 */
+ b_ssm = (ipv4 >> 24) == 232;
+ }
+
if( ipv4 == 0 )
{
msg_Err( p_sap, "Out-of-scope multicast address "
if( p_session->psz_sdp == NULL )
{
p_session->psz_sdp = SDPGenerate( p_sap, p_session,
- p_sap_session->p_address );
+ p_sap_session->p_address, b_ssm );
if( p_session->psz_sdp == NULL )
{
vlc_mutex_unlock( &p_sap->object_lock );
static char *SDPGenerate( sap_handler_t *p_sap,
const session_descriptor_t *p_session,
- const sap_address_t *p_addr )
+ const sap_address_t *p_addr, vlc_bool_t b_ssm )
{
int64_t i_sdp_id = mdate();
int i_sdp_version = 1 + p_sap->i_sessions + (rand()&0xfff);
psz_uri = p_session->psz_uri;
char *sfilter = NULL;
- if (var_CreateGetBool (p_sap, "sap-source-filter"))
+ if (b_ssm)
{
if (asprintf (&sfilter, "a=source-filter: incl IN IP%c * %s\r\n",
ipv, p_addr->psz_machine) == -1)