- const char *psz_next = strchr( psz_parser, ':' );
- if( psz_next == NULL )
- psz_next = psz_parser + strlen( psz_parser );
-
- char psz_plugin[psz_next - psz_parser + 1];
- memcpy (psz_plugin, psz_parser, sizeof (psz_plugin) - 1);
- psz_plugin[sizeof (psz_plugin) - 1] = '\0';
- psz_parser = psz_next;
-
- /* Perform the addition */
- msg_Dbg( p_playlist, "Add services_discovery %s", psz_plugin );
- services_discovery_t *p_sd;
-
- p_sd = services_discovery_Create( (vlc_object_t*)p_playlist, psz_plugin );
- 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,
- p_one );
-
- vlc_event_attach( services_discovery_EventManager( p_sd ),
- vlc_ServicesDiscoveryItemAdded,
- playlist_sd_item_added,
- p_cat );
-
- vlc_event_attach( services_discovery_EventManager( p_sd ),
- vlc_ServicesDiscoveryItemRemoved,
- playlist_sd_item_removed,
- p_one );
-
- vlc_event_attach( services_discovery_EventManager( p_sd ),
- vlc_ServicesDiscoveryItemRemoved,
- playlist_sd_item_removed,
- p_cat );
-
- bool ret = services_discovery_Start( p_sd );
- if(!ret)