Commit 190fa71e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Allow NULL module capability

The module will never be proved. This applies to the "main" module
and the playlist demux (which only has submodules).
parent f62b7be0
......@@ -2811,7 +2811,6 @@ vlc_module_begin ()
/* add_usage_hint( PLAYLIST_USAGE ) */
set_description( N_("main program") )
set_capability( "main", 100 )
vlc_module_end ()
/*****************************************************************************
......
......@@ -63,7 +63,7 @@ module_t *vlc_module_create (void)
module->psz_help = NULL;
module->pp_shortcuts = NULL;
module->i_shortcuts = 0;
module->psz_capability = (char*)"";
module->psz_capability = NULL;
module->i_score = 1;
module->b_unloadable = true;
module->pf_activate = NULL;
......
......@@ -190,6 +190,8 @@ void module_LoadPlugins (vlc_object_t *obj)
*/
bool module_provides( const module_t *m, const char *cap )
{
if (unlikely(m->psz_capability == NULL))
return false;
return !strcmp( m->psz_capability, cap );
}
......@@ -1071,7 +1073,8 @@ static void DupModule( module_t *p_module )
/* We strdup() these entries so that they are still valid when the
* module is unloaded. */
p_module->psz_capability = strdup( p_module->psz_capability );
p_module->psz_capability =
p_module->psz_capability ? strdup( p_module->psz_capability ) : NULL;
p_module->psz_shortname = p_module->psz_shortname ?
strdup( p_module->psz_shortname ) : NULL;
p_module->psz_longname = strdup( p_module->psz_longname );
......
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