[vlc-commits] sd: remove RemoveAll events
Rémi Denis-Courmont
git at videolan.org
Mon Nov 14 19:41:08 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 14 20:35:57 2016 +0200| [74acdbca75dd6368df3cb3b3435cc38cb639a24b] | committer: Rémi Denis-Courmont
sd: remove RemoveAll events
This was never triggered.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=74acdbca75dd6368df3cb3b3435cc38cb639a24b
---
include/vlc_events.h | 3 +--
include/vlc_services_discovery.h | 1 -
lib/media_discoverer.c | 25 -------------------------
src/libvlccore.sym | 1 -
src/playlist/services_discovery.c | 28 ----------------------------
5 files changed, 1 insertion(+), 57 deletions(-)
diff --git a/include/vlc_events.h b/include/vlc_events.h
index 01e11d0..ade84cf 100644
--- a/include/vlc_events.h
+++ b/include/vlc_events.h
@@ -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 */
diff --git a/include/vlc_services_discovery.h b/include/vlc_services_discovery.h
index d9c231b..22df2fc 100644
--- a/include/vlc_services_discovery.h
+++ b/include/vlc_services_discovery.h
@@ -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 */
diff --git a/lib/media_discoverer.c b/lib/media_discoverer.c
index 29dcda0..ce56a01 100644
--- a/lib/media_discoverer.c
+++ b/lib/media_discoverer.c
@@ -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 );
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 915c6e1..b3a5ddb 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -378,7 +378,6 @@ secstotimestr
services_discovery_AddItem
services_discovery_EventManager
services_discovery_GetLocalizedName
-services_discovery_RemoveAll
services_discovery_RemoveItem
sout_AccessOutControl
sout_AccessOutDelete
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index b074907..76b9349 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -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);
@@ -217,18 +216,6 @@ services_discovery_EventManager ( services_discovery_t * p_sd )
}
/*******************************************************************//**
- * 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
***********************************************************************/
void
@@ -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 );
More information about the vlc-commits
mailing list