From 4b1b77b6f20194b3c0e30f38723e3c01859bd903 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 22 Jul 2002 22:19:49 +0000 Subject: [PATCH] * ./src/misc/modules.c: added the "any" and "none" keywords to the module selection string. "any" matches any module, and "none" always fails. You can for instance use "--vout none" to disable video output, or "--intf gtk,any" to use the gtk interface or any other one if gtk isn't available. Hope it's clear :) --- src/misc/modules.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/misc/modules.c b/src/misc/modules.c index f3014036a5..138e0924f7 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -2,7 +2,7 @@ * modules.c : Builtin and plugin modules management functions ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.c,v 1.72 2002/07/20 18:01:43 sam Exp $ + * $Id: modules.c,v 1.73 2002/07/22 22:19:49 sam Exp $ * * Authors: Samuel Hocevar * Ethan C. Baldridge @@ -285,14 +285,17 @@ module_t * __module_Need( vlc_object_t *p_this, int i_capability, msg_Dbg( p_this, "looking for %s module", MODULE_CAPABILITY( i_capability ) ); - /* We take the global lock */ - vlc_mutex_lock( &p_this->p_vlc->module_bank.lock ); - /* Count how many different shortcuts were asked for */ if( psz_name && *psz_name ) { char *psz_parser; + /* If the user wants none, give him none. */ + if( !strcmp( psz_name, "none" ) ) + { + return NULL; + } + i_shortcuts++; psz_shortcuts = strdup( psz_name ); @@ -306,6 +309,9 @@ module_t * __module_Need( vlc_object_t *p_this, int i_capability, } } + /* We take the global lock */ + vlc_mutex_lock( &p_this->p_vlc->module_bank.lock ); + /* Sort the modules and test them */ p_list = malloc( p_this->p_vlc->module_bank.i_count * sizeof( module_list_t ) ); @@ -345,8 +351,8 @@ module_t * __module_Need( vlc_object_t *p_this, int i_capability, b_trash && p_module->pp_shortcuts[i_dummy]; i_dummy++ ) { - b_trash = strcmp( psz_name, - p_module->pp_shortcuts[i_dummy] ); + b_trash = strcmp( psz_name, "any" ) + && strcmp( psz_name, p_module->pp_shortcuts[i_dummy] ); } if( !b_trash ) @@ -355,6 +361,7 @@ module_t * __module_Need( vlc_object_t *p_this, int i_capability, break; } + /* Go to the next shortcut... This is so lame! */ while( *psz_name ) { psz_name++; -- 2.20.1