Commit 74acdbca authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

sd: remove RemoveAll events

This was never triggered.
parent 893ef33a
......@@ -124,8 +124,7 @@ typedef enum vlc_event_type_t {
/* Service Discovery event */
vlc_ServicesDiscoveryItemAdded,
vlc_ServicesDiscoveryItemRemoved,
vlc_ServicesDiscoveryItemRemoveAll,
vlc_ServicesDiscoveryStarted,
vlc_ServicesDiscoveryStarted=vlc_ServicesDiscoveryItemRemoved+2,
vlc_ServicesDiscoveryEnded,
/* Renderer Discovery events */
......
......@@ -157,7 +157,6 @@ VLC_API vlc_event_manager_t * services_discovery_EventManager( services_discover
* for more options, directly set the (meta) data on the input item */
VLC_API void services_discovery_AddItem( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category );
VLC_API void services_discovery_RemoveItem( services_discovery_t * p_this, input_item_t * p_item );
VLC_API void services_discovery_RemoveAll( services_discovery_t * p_sd );
/* SD probing */
......
......@@ -131,23 +131,6 @@ static void services_discovery_item_removed( const vlc_event_t * p_event,
libvlc_media_list_unlock( p_mdis->p_mlist );
}
/**************************************************************************
* services_discovery_removeall (Private) (VLC event callback)
**************************************************************************/
static void services_discovery_removeall( const vlc_event_t * p_event,
void * user_data )
{
VLC_UNUSED(p_event);
libvlc_media_discoverer_t * p_mdis = user_data;
libvlc_media_list_lock( p_mdis->p_mlist );
for( int i = 0; i < libvlc_media_list_count( p_mdis->p_mlist ); i++ )
{
libvlc_media_list_internal_remove_index( p_mdis->p_mlist, i );
}
libvlc_media_list_unlock( p_mdis->p_mlist );
}
/*
* Public libvlc functions
*/
......@@ -202,10 +185,6 @@ libvlc_media_discoverer_new( libvlc_instance_t * p_inst, const char * psz_name )
vlc_ServicesDiscoveryItemRemoved,
services_discovery_item_removed,
p_mdis );
vlc_event_attach( services_discovery_EventManager( p_mdis->p_sd ),
vlc_ServicesDiscoveryItemRemoveAll,
services_discovery_removeall,
p_mdis );
libvlc_retain( p_inst );
return p_mdis;
......@@ -285,10 +264,6 @@ libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis )
vlc_ServicesDiscoveryItemRemoved,
services_discovery_item_removed,
p_mdis );
vlc_event_detach( services_discovery_EventManager( p_mdis->p_sd ),
vlc_ServicesDiscoveryItemRemoveAll,
services_discovery_removeall,
p_mdis );
if( p_mdis->running )
libvlc_media_discoverer_stop( p_mdis );
......
......@@ -378,7 +378,6 @@ secstotimestr
services_discovery_AddItem
services_discovery_EventManager
services_discovery_GetLocalizedName
services_discovery_RemoveAll
services_discovery_RemoveItem
sout_AccessOutControl
sout_AccessOutDelete
......
......@@ -126,7 +126,6 @@ services_discovery_t *vlc_sd_Create( vlc_object_t *p_super,
vlc_event_manager_init( em, p_sd );
vlc_event_manager_register_event_type(em, vlc_ServicesDiscoveryItemAdded);
vlc_event_manager_register_event_type(em, vlc_ServicesDiscoveryItemRemoved);
vlc_event_manager_register_event_type(em, vlc_ServicesDiscoveryItemRemoveAll);
vlc_event_manager_register_event_type(em, vlc_ServicesDiscoveryStarted);
vlc_event_manager_register_event_type(em, vlc_ServicesDiscoveryEnded);
......@@ -216,18 +215,6 @@ services_discovery_EventManager ( services_discovery_t * p_sd )
return &p_sd->event_manager;
}
/*******************************************************************//**
* Remove all items from the Service Discovery listing
***********************************************************************/
void
services_discovery_RemoveAll ( services_discovery_t * p_sd )
{
vlc_event_t event;
event.type = vlc_ServicesDiscoveryItemRemoveAll;
vlc_event_send( &p_sd->event_manager, &event );
}
/*******************************************************************//**
* Add an item to the Service Discovery listing
***********************************************************************/
......@@ -327,18 +314,6 @@ static void playlist_sd_item_removed( const vlc_event_t * p_event, void * user_d
PL_UNLOCK;
}
/* A request to remove all ideas from SD */
static void playlist_sd_item_removeall( const vlc_event_t * p_event, void * user_data )
{
VLC_UNUSED(p_event);
playlist_item_t* p_sd_node = user_data;
if( p_sd_node == NULL ) return;
playlist_t* p_playlist = p_sd_node->p_playlist;
PL_LOCK;
playlist_NodeEmpty( p_playlist, p_sd_node, true );
PL_UNLOCK;
}
int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,
const char *psz_name )
{
......@@ -390,9 +365,6 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,
vlc_event_attach( em, vlc_ServicesDiscoveryItemRemoved,
playlist_sd_item_removed, p_node );
vlc_event_attach( em, vlc_ServicesDiscoveryItemRemoveAll,
playlist_sd_item_removeall, p_node );
if( !vlc_sd_Start( p_sd ) )
{
vlc_sd_Destroy( p_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