]> git.sesse.net Git - vlc/commitdiff
* ./src/misc/modules.c: if a module has a zero-scored capability, we don't
authorSam Hocevar <sam@videolan.org>
Tue, 14 May 2002 19:47:25 +0000 (19:47 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 14 May 2002 19:47:25 +0000 (19:47 +0000)
    try to use it, unless it was explicitely requested (--vout for example).

plugins/satellite/satellite.c
src/misc/modules.c

index b7879770b037c959fa82863892750a9c4befda56..8051cc220638a85902b2d0838f27794fb0701b01 100644 (file)
@@ -76,8 +76,9 @@ MODULE_CONFIG_STOP
 
 MODULE_INIT_START
     SET_DESCRIPTION( _("satellite input module") )
-    ADD_CAPABILITY( ACCESS, 50 )
+    ADD_CAPABILITY( ACCESS, 0 )
     ADD_SHORTCUT( "satellite" )
+    ADD_SHORTCUT( "sat" )
 MODULE_INIT_STOP
 
 MODULE_ACTIVATE_START
index b017449dd73086c34ad04394b2c2994426f09c87..ff14769a453ecdc0dc59555789854a9a27db944b 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Built-in and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.58 2002/04/11 08:55:49 sam Exp $
+ * $Id: modules.c,v 1.59 2002/05/14 19:47:25 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -312,24 +312,29 @@ module_t * module_Need( int i_capability, char *psz_name, void *p_data )
             continue;
         }
 
-        /* Test if this plugin exports the required shortcut */
+        /* If we required a shortcut, check this plugin provides it. */
         if( psz_name != NULL && *psz_name )
         {
-            boolean_t b_ok = 0;
+            boolean_t b_trash = 1;
             int i_dummy;
 
             for( i_dummy = 0;
-                 !b_ok && p_module->pp_shortcuts[i_dummy];
+                 b_trash && p_module->pp_shortcuts[i_dummy];
                  i_dummy++ )
             {
-                b_ok = !strcmp( psz_name, p_module->pp_shortcuts[i_dummy] );
+                b_trash = strcmp( psz_name, p_module->pp_shortcuts[i_dummy] );
             }
 
-            if( !b_ok )
+            if( b_trash )
             {
                 continue;
             }
         }
+        /* If we didn't require a shortcut, trash zero-scored plugins */
+        else if( !p_module->pi_score[i_capability] )
+        {
+            continue;
+        }
 
         /* Special case: test if we requested a particular intf plugin */
         if( i_capability == MODULE_CAPABILITY_INTF )