char * psz_module;
module_t * p_module;
- char * psz_localized_name; /* Accessed through Setters for non class function */
vlc_event_manager_t event_manager; /* Accessed through Setters for non class function */
services_discovery_sys_t *p_sys;
VLC_EXPORT( vlc_event_manager_t *, services_discovery_EventManager, ( services_discovery_t * p_this ) );
/* Used by services_discovery to post update about their items */
-VLC_EXPORT( void, services_discovery_SetLocalizedName, ( services_discovery_t * p_this, const char * ) );
/* About the psz_category, it is a legacy way to add info to the item,
* for more options, directly set the (meta) data on the input item */
VLC_EXPORT( void, services_discovery_AddItem, ( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category ) );
goto error;
}
- services_discovery_SetLocalizedName( p_sd, _("Bonjour") );
-
return VLC_SUCCESS;
error:
if( vlc_clone( &p_sys->thread, Run, p_this, VLC_THREAD_PRIORITY_LOW ) )
goto error;
- services_discovery_SetLocalizedName( p_sd, _("Devices") );
-
return VLC_SUCCESS;
error:
dbus_error_free( &dbus_error );
p_sys->b_update = true;
p_sd->p_sys = p_sys;
- /* Give us a name */
- services_discovery_SetLocalizedName( p_sd, _("Podcasts") );
/* Launch the callback associated with this variable */
var_Create( p_sd, "podcast-urls", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
/* Cache sap_timeshift value */
p_sys->b_timeshift = var_CreateGetInteger( p_sd, "sap-timeshift" );
- /* Set our name */
- services_discovery_SetLocalizedName( p_sd, _("SAP") );
-
p_sys->i_announces = 0;
p_sys->pp_announces = NULL;
/* TODO: create sockets here, and fix racy sockets table */
static int Open( vlc_object_t *p_this, enum type_e i_type )
{
services_discovery_t *p_sd = ( services_discovery_t* )p_this;
- services_discovery_SetLocalizedName( p_sd, _(p_items[i_type].psz_name) );
p_sd->p_sys = malloc (sizeof (*(p_sd->p_sys)));
if (p_sd->p_sys == NULL)
{
services_discovery_t *p_sd = ( services_discovery_t* )p_this;
- services_discovery_SetLocalizedName( p_sd, _("Devices") );
-
UPnPHandler *u = new UPnPHandler( p_sd );
u->start( );
msg_Dbg( p_sd, "upnp discovery started" );
if(!(p_sd->p_sys = p_sys))
return VLC_ENOMEM;
- services_discovery_SetLocalizedName( p_sd, _("UPnP devices") );
-
res = UpnpInit( 0, 0 );
if( res != UPNP_E_SUCCESS )
{
services_discovery_GetLocalizedName
__services_discovery_GetServicesNames
services_discovery_RemoveItem
-services_discovery_SetLocalizedName
services_discovery_Start
services_discovery_Stop
sout_AccessOutControl
if( !p_sd )
return NULL;
- p_sd->psz_localized_name = strdup( "Unnamed service discovery" ); // FIXME: Set that back to NULL
p_sd->psz_module = strdup( psz_module_name );
vlc_event_manager_init( &p_sd->event_manager, p_sd, (vlc_object_t *)p_sd );
assert(!p_sd->p_module); /* Forgot to call Stop */
vlc_event_manager_fini( &p_sd->event_manager );
-
free( p_sd->psz_module );
- free( p_sd->psz_localized_name );
-
vlc_object_release( p_sd );
}
char *
services_discovery_GetLocalizedName ( services_discovery_t * p_sd )
{
- return p_sd->psz_localized_name ? strdup( p_sd->psz_localized_name ) : NULL;
-}
-
-/***********************************************************************
- * SetLocalizedName
- ***********************************************************************/
-void
-services_discovery_SetLocalizedName ( services_discovery_t * p_sd, const char *psz )
-{
- free( p_sd->psz_localized_name );
- p_sd->psz_localized_name = strdup(psz);
+ return strdup( module_get_name( p_sd->p_module, true ) );
}
/***********************************************************************
if( !p_sd )
continue;
- /* FIXME: Thanks to previous changeset this is broken */
- char * psz = services_discovery_GetLocalizedName( p_sd );
- assert( psz );
- PL_LOCK;
- playlist_NodesPairCreate( p_playlist, psz,
- &p_cat, &p_one, false );
- PL_UNLOCK;
- free( psz );
-
vlc_event_attach( services_discovery_EventManager( p_sd ),
vlc_ServicesDiscoveryItemAdded,
playlist_sd_item_added,
vlc_object_release( p_sd );
return VLC_EGENERIC;
}
-
+
+ char *psz = services_discovery_GetLocalizedName( p_sd );
+ assert( psz );
+ PL_LOCK;
+ playlist_NodesPairCreate( p_playlist, psz,
+ &p_cat, &p_one, false );
+ PL_UNLOCK;
+ free( psz );
+
/* Free in playlist_ServicesDiscoveryRemove */
p_sds = malloc( sizeof(struct playlist_services_discovery_support_t) );
if( !p_sds )