* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include <assert.h>
+
#include <vlc/vlc.h>
#include "vlc_playlist.h"
#include "vlc_events.h"
vlc_ServicesDiscoveryItemAdded );
vlc_event_manager_register_event_type( &p_sd->event_manager,
vlc_ServicesDiscoveryItemRemoved );
+ vlc_event_manager_register_event_type( &p_sd->event_manager,
+ vlc_ServicesDiscoveryStarted );
+ vlc_event_manager_register_event_type( &p_sd->event_manager,
+ vlc_ServicesDiscoveryEnded );
p_sd->p_module = module_Need( p_sd, "services_discovery", psz_module_name, VLC_TRUE );
***********************************************************************/
static void RunSD( services_discovery_t *p_sd )
{
+ vlc_event_t event;
+
+ event.type = vlc_ServicesDiscoveryStarted;
+ vlc_event_send( &p_sd->event_manager, &event );
+
p_sd->pf_run( p_sd );
+
+ event.type = vlc_ServicesDiscoveryEnded;
+ vlc_event_send( &p_sd->event_manager, &event );
return;
}
continue;
char * psz = services_discovery_GetLocalizedName( p_sd );
- if( psz )
- {
- playlist_NodesPairCreate( p_playlist, psz,
- &p_cat, &p_one, VLC_FALSE );
- free( psz );
- }
- else
- {
- /* No name, just add at the top of the playlist */
- PL_LOCK;
- p_cat = p_playlist->p_root_category;
- p_one = p_playlist->p_root_onelevel;
- PL_UNLOCK;
- }
+ assert( psz );
+ playlist_NodesPairCreate( p_playlist, psz,
+ &p_cat, &p_one, VLC_FALSE );
+ free( psz );
vlc_event_attach( services_discovery_EventManager( p_sd ),
vlc_ServicesDiscoveryItemAdded,