From: Rémi Denis-Courmont Date: Sat, 6 Feb 2010 15:17:55 +0000 (+0200) Subject: SD listing: remove module lookup hack X-Git-Tag: 1.1.0-ff~369 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b06569fa74e7af8f051034ddf6e9832c711d68c6;p=vlc SD listing: remove module lookup hack Based on an idea from Jean-Philippe André --- diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c index eb35edb472..96b79aff26 100644 --- a/src/playlist/services_discovery.c +++ b/src/playlist/services_discovery.c @@ -291,27 +291,18 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, if( !p_sd ) return VLC_ENOMEM; - module_t *m = module_find_by_shortcut( p_sd->psz_name ); - if( !m ) - { - msg_Err( p_playlist, "No such module: %s", p_sd->psz_name ); - vlc_sd_Destroy( p_sd ); - return VLC_EGENERIC; - } - /* Free in playlist_ServicesDiscoveryRemove */ vlc_sd_internal_t * p_sds = malloc( sizeof(*p_sds) ); if( !p_sds ) { vlc_sd_Destroy( p_sd ); - module_release( m ); return VLC_ENOMEM; } playlist_item_t *p_node; /* Look for configuration chain "longname" */ - const char *psz_longname = NULL; + const char *psz_longname = "?"; if( p_sd->p_cfg ) { config_chain_t *cfg = p_sd->p_cfg; @@ -326,17 +317,10 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, } } - /* Fallback on module's long name if not found */ - if( !psz_longname ) - { - psz_longname = module_get_name( m, true ); - } - PL_LOCK; p_node = playlist_NodeCreate( p_playlist, psz_longname, p_playlist->p_root, 0, NULL ); PL_UNLOCK; - module_release( m ); vlc_event_attach( services_discovery_EventManager( p_sd ), vlc_ServicesDiscoveryItemAdded,