Commit 8bc47474 authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/modules.c: module_Need() now only raises the scores of the
   plugins matching the given shortcuts list, unless "none" is closing the
   list (in which case only the plugins matching the list can be selected).

   Which means that users will stop complaining vlc doesn't launch anymore
   or can't play anything after they have fiddled with their config
   options :))
parent d5659d9d
......@@ -2,7 +2,7 @@
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.116 2003/03/12 05:26:46 sam Exp $
* $Id: modules.c,v 1.117 2003/03/25 15:38:14 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
......@@ -340,23 +340,40 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
/* If we required a shortcut, check this plugin provides it. */
if( i_shortcuts )
{
vlc_bool_t b_trash = VLC_TRUE;
vlc_bool_t b_trash;
int i_dummy, i_short = i_shortcuts;
char *psz_name = psz_shortcuts;
/* Let's drop modules with a 0 score (unless they are
* explicitly requested) */
b_trash = !p_module->i_score;
while( i_short )
{
for( i_dummy = 0;
b_trash && p_module->pp_shortcuts[i_dummy];
i_dummy++ )
/* If the last given shortcut is "none" and we couldn't
* find the module in the list of provided shortcuts,
* then kick the bastard out of here!!! */
if( (i_short == 1) && !strcmp(psz_name, "none") )
{
b_trash = VLC_TRUE;
break;
}
for( i_dummy = 0; p_module->pp_shortcuts[i_dummy]; i_dummy++ )
{
b_trash = ( strcmp(psz_name, "any") || !p_module->i_score )
&& strcmp( psz_name, p_module->pp_shortcuts[i_dummy] );
if( !strcmp( psz_name,
p_module->pp_shortcuts[i_dummy] ) )
{
/* Found it */
b_trash = VLC_FALSE;
i_shortcut_bonus = i_short * 10000;
break;
}
}
if( !b_trash )
if( i_shortcut_bonus )
{
i_shortcut_bonus = i_short * 10000;
/* We found it... remember ? */
break;
}
......
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