Commit bb80eba0 authored by Christophe Mutricy's avatar Christophe Mutricy

services_discovery/*: String review (refs #438) and suppress the sap-addr option

parent 8d87383f
...@@ -220,7 +220,7 @@ static int OpenAccess( vlc_object_t *p_this ) ...@@ -220,7 +220,7 @@ static int OpenAccess( vlc_object_t *p_this )
if( p_sys->p_db == NULL || i_ret ) if( p_sys->p_db == NULL || i_ret )
{ {
msg_Err( p_access, "The DAAP services_discovery module must be enabled" ); msg_Err( p_access, "the DAAP services_discovery module must be enabled" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -276,7 +276,7 @@ static int OpenAccess( vlc_object_t *p_this ) ...@@ -276,7 +276,7 @@ static int OpenAccess( vlc_object_t *p_this )
} }
msg_Dbg( p_access, "Downloading %s song %i (db %i)", msg_Dbg( p_access, "downloading %s song %i (db %i)",
p_sys->songdata.songformat, p_sys->songdata.songformat,
p_sys->i_song, p_sys->p_host->i_database_id ); p_sys->i_song, p_sys->p_host->i_database_id );
...@@ -287,7 +287,7 @@ static int OpenAccess( vlc_object_t *p_this ) ...@@ -287,7 +287,7 @@ static int OpenAccess( vlc_object_t *p_this )
p_sys->songdata.songformat, p_sys->songdata.songformat,
&(p_sys->song) ); &(p_sys->song) );
msg_Dbg( p_access, "Finished downloading, read %i bytes (ret %i)", msg_Dbg( p_access, "finished downloading, read %i bytes (ret %i)",
p_sys->song.size, i_ret ); p_sys->song.size, i_ret );
p_access->info.i_size = p_sys->song.size; p_access->info.i_size = p_sys->song.size;
......
...@@ -115,14 +115,14 @@ static int Open( vlc_object_t *p_this ) ...@@ -115,14 +115,14 @@ static int Open( vlc_object_t *p_this )
p_sys->p_ctx = libhal_ctx_new(); p_sys->p_ctx = libhal_ctx_new();
if( !p_sys->p_ctx ) if( !p_sys->p_ctx )
{ {
msg_Err( p_sd, "Unable to create HAL context") ; msg_Err( p_sd, "unable to create HAL context") ;
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_connection = dbus_bus_get( DBUS_BUS_SYSTEM, &dbus_error ); p_connection = dbus_bus_get( DBUS_BUS_SYSTEM, &dbus_error );
if( dbus_error_is_set( &dbus_error ) ) if( dbus_error_is_set( &dbus_error ) )
{ {
msg_Err( p_sd, "Unable to connect to DBUS: %s", dbus_error.message ); msg_Err( p_sd, "unable to connect to DBUS: %s", dbus_error.message );
dbus_error_free( &dbus_error ); dbus_error_free( &dbus_error );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -76,8 +76,6 @@ static const char ipv6_scopes[] = "1456789ABCDE"; ...@@ -76,8 +76,6 @@ static const char ipv6_scopes[] = "1456789ABCDE";
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define SAP_ADDR_TEXT N_( "SAP multicast address" )
#define SAP_ADDR_LONGTEXT N_( "Listen for SAP announcements on another address" )
#define SAP_IPV4_TEXT N_( "IPv4-SAP listening" ) #define SAP_IPV4_TEXT N_( "IPv4-SAP listening" )
#define SAP_IPV4_LONGTEXT N_( \ #define SAP_IPV4_LONGTEXT N_( \
"Set this if you want the SAP module to listen to IPv4 announcements " \ "Set this if you want the SAP module to listen to IPv4 announcements " \
...@@ -123,8 +121,6 @@ vlc_module_begin(); ...@@ -123,8 +121,6 @@ vlc_module_begin();
set_category( CAT_PLAYLIST ); set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_SD ); 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, add_bool( "sap-ipv4", 1 , NULL,
SAP_IPV4_TEXT,SAP_IPV4_LONGTEXT, VLC_TRUE ); SAP_IPV4_TEXT,SAP_IPV4_LONGTEXT, VLC_TRUE );
add_bool( "sap-ipv6", 1 , NULL, add_bool( "sap-ipv6", 1 , NULL,
...@@ -139,6 +135,7 @@ vlc_module_begin(); ...@@ -139,6 +135,7 @@ vlc_module_begin();
SAP_CACHE_TEXT,SAP_CACHE_LONGTEXT, VLC_TRUE ); SAP_CACHE_TEXT,SAP_CACHE_LONGTEXT, VLC_TRUE );
add_bool( "sap-timeshift", 0 , NULL, add_bool( "sap-timeshift", 0 , NULL,
SAP_TIMESHIFT_TEXT,SAP_TIMESHIFT_LONGTEXT, VLC_TRUE ); SAP_TIMESHIFT_TEXT,SAP_TIMESHIFT_LONGTEXT, VLC_TRUE );
add_suppressed_string( "sap-addr" );
set_capability( "services_discovery", 0 ); set_capability( "services_discovery", 0 );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
...@@ -418,7 +415,7 @@ error: ...@@ -418,7 +415,7 @@ error:
free( psz_sdp ); free( psz_sdp );
if( p_sdp ) FreeSDP( p_sdp ); if( p_sdp ) FreeSDP( p_sdp );
stream_Seek( p_demux->s, 0 ); stream_Seek( p_demux->s, 0 );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/***************************************************************************** /*****************************************************************************
...@@ -503,12 +500,6 @@ static void Run( services_discovery_t *p_sd ) ...@@ -503,12 +500,6 @@ 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 ) if( p_sd->p_sys->i_fd == 0 )
{ {
msg_Err( p_sd, "unable to listen on any address" ); msg_Err( p_sd, "unable to listen on any address" );
...@@ -650,7 +641,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read ) ...@@ -650,7 +641,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
psz_sdp += 4; psz_sdp += 4;
if( i_read <= 9 ) if( i_read <= 9 )
{ {
msg_Warn( p_sd, "too short SAP packet\n" ); msg_Warn( p_sd, "too short SAP packet" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
} }
...@@ -659,7 +650,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read ) ...@@ -659,7 +650,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
psz_sdp += 16; psz_sdp += 16;
if( i_read <= 21 ) if( i_read <= 21 )
{ {
msg_Warn( p_sd, "too short SAP packet\n" ); msg_Warn( p_sd, "too short SAP packet" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
} }
...@@ -679,7 +670,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read ) ...@@ -679,7 +670,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
free( p_decompressed_buffer ); free( p_decompressed_buffer );
} }
#else #else
msg_Warn( p_sd, "Ignoring compressed sap packet" ); msg_Warn( p_sd, "ignoring compressed sap packet" );
return VLC_EGENERIC; return VLC_EGENERIC;
#endif #endif
} }
...@@ -710,7 +701,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read ) ...@@ -710,7 +701,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
} }
if( ( psz_sdp != psz_foo ) && strcasecmp( psz_foo, "application/sdp" ) ) if( ( psz_sdp != psz_foo ) && strcasecmp( psz_foo, "application/sdp" ) )
{ {
msg_Dbg( p_sd, "unhandled content type: %s", psz_foo ); msg_Dbg( p_sd, "unhandled content type: %s", psz_foo );
} }
if( ( psz_sdp - (char *)p_buffer ) >= i_read ) if( ( psz_sdp - (char *)p_buffer ) >= i_read )
{ {
...@@ -767,7 +758,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read ) ...@@ -767,7 +758,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
/* Add item */ /* Add item */
if( p_sdp->i_media > 1 ) if( p_sdp->i_media > 1 )
{ {
msg_Dbg( p_sd, "passing to LIVE.COM" ); msg_Dbg( p_sd, "passing to liveMedia" );
} }
CreateAnnounce( p_sd, i_hash, p_sdp ); CreateAnnounce( p_sd, i_hash, p_sdp );
...@@ -1064,7 +1055,7 @@ static sdp_t * ParseSDP( vlc_object_t *p_obj, char* psz_sdp ) ...@@ -1064,7 +1055,7 @@ static sdp_t * ParseSDP( vlc_object_t *p_obj, char* psz_sdp )
if( psz_sdp[0] != 'v' || psz_sdp[1] != '=' ) if( psz_sdp[0] != 'v' || psz_sdp[1] != '=' )
{ {
msg_Warn( p_obj, "Bad packet" ); msg_Warn( p_obj, "bad packet" );
return NULL; return NULL;
} }
...@@ -1403,10 +1394,10 @@ static vlc_bool_t IsSameSession( sdp_t *p_sdp1, sdp_t *p_sdp2 ) ...@@ -1403,10 +1394,10 @@ static vlc_bool_t IsSameSession( sdp_t *p_sdp1, sdp_t *p_sdp2 )
static void CacheLoad( services_discovery_t *p_sd ) static void CacheLoad( services_discovery_t *p_sd )
{ {
msg_Warn( p_sd, "Cache not implemented") ; msg_Warn( p_sd, "cache not implemented") ;
} }
static void CacheSave( services_discovery_t *p_sd ) static void CacheSave( services_discovery_t *p_sd )
{ {
msg_Warn( p_sd, "Cache not implemented") ; msg_Warn( p_sd, "cache not implemented") ;
} }
...@@ -58,13 +58,12 @@ ...@@ -58,13 +58,12 @@
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close( vlc_object_t * ); static void Close( vlc_object_t * );
/// \bug Shortdesc too long #define LIMIT_TEXT N_("Number of streams")
#define LIMIT_TEXT N_("Maximum number of shoutcast servers to be listed") #define LIMIT_LONGTEXT N_("Maximum number of Shoutcast radio streams which " \
#define LIMIT_LONGTEXT LIMIT_TEXT "would be listed.")
vlc_module_begin(); vlc_module_begin();
set_shortname( "Shoutcast"); set_shortname( "Shoutcast");
/// \bug Correct ?
set_description( _("Shoutcast radio listings") ); set_description( _("Shoutcast radio listings") );
set_category( CAT_PLAYLIST ); set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_SD ); set_subcategory( SUBCAT_PLAYLIST_SD );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment