]> git.sesse.net Git - vlc/commitdiff
* ALL: changed the prototype of module_Need() to accept a "strict" boolean argument.
authorGildas Bazin <gbazin@videolan.org>
Wed, 3 Mar 2004 20:39:53 +0000 (20:39 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 3 Mar 2004 20:39:53 +0000 (20:39 +0000)
If "strict" is true and a module name is provided then module_Need() will only look for the specified module
If "strict" is false, then module_Need() will first look for the specified module and if it wasn't found, will continue with the other modules with the same "capability".

43 files changed:
include/modules.h
modules/access/dvd/demux.c
modules/access/dvdplay/demux.c
modules/access/dvdread/input.c
modules/access/vcdx/demux.c
modules/access_output/udp.c
modules/audio_filter/resampler/coreaudio.c
modules/demux/a52.c
modules/demux/aac.c
modules/demux/demuxstream.c
modules/demux/dts.c
modules/demux/flac.c
modules/demux/mpeg/m4v.c
modules/demux/mpeg/mpga.c
modules/demux/mpeg/mpgv.c
modules/demux/mpeg/ps.c
modules/demux/mpeg/ts.c
modules/demux/util/sub.h
modules/gui/gtk/gnome.c
modules/gui/gtk/gtk.c
modules/gui/gtk2/gnome2.c
modules/gui/gtk2/gtk2.c
modules/gui/pda/pda.c
modules/gui/skins/src/dialogs.cpp
modules/gui/skins2/src/dialogs.cpp
modules/misc/sap.c
modules/stream_out/announce.c
modules/stream_out/transcode.c
modules/video_output/qte/qte.cpp
src/audio_output/filters.c
src/audio_output/input.c
src/audio_output/mixer.c
src/audio_output/output.c
src/input/demux.c
src/input/input.c
src/input/input_dec.c
src/interface/interface.c
src/libvlc.c
src/misc/modules.c
src/misc/net.c
src/playlist/loadsave.c
src/stream_output/stream_output.c
src/video_output/video_output.c

index f5b97f308c8a32c2d08fa0ba5fceca71ed9a462f..c26746d7a818d94c6ce15e50a72d1b4f7a1f888d 100644 (file)
@@ -2,7 +2,7 @@
  * modules.h : Module management functions.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.65 2003/10/04 12:25:00 sam Exp $
+ * $Id: modules.h,v 1.66 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -126,8 +126,8 @@ void  __module_EndBank         ( vlc_object_t * );
 #define module_ResetBank(a)    __module_ResetBank(VLC_OBJECT(a))
 void  __module_ResetBank       ( vlc_object_t * );
 
-#define module_Need(a,b,c) __module_Need(VLC_OBJECT(a),b,c)
-VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, const char *, const char * ) );
+#define module_Need(a,b,c,d) __module_Need(VLC_OBJECT(a),b,c,d)
+VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, const char *, const char *, vlc_bool_t ) );
 #define module_Unneed(a,b) __module_Unneed(VLC_OBJECT(a),b)
 VLC_EXPORT( void, __module_Unneed, ( vlc_object_t *, module_t * ) );
 
index 6754a069f432e97fd72a0ade95ac0c060fdf5b0f..dc05fc37334aa3921ec627f1c2981d8cc14fa775 100644 (file)
@@ -1,7 +1,7 @@
 /* demux.c: DVD demux functions.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.3 2003/09/07 22:49:05 fenrir Exp $
+ * $Id: demux.c,v 1.4 2004/03/03 20:39:51 gbazin Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -85,7 +85,7 @@ int E_(DVDInit) ( vlc_object_t *p_this )
     }
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index afd1a465eabfe458b62b9ca6a7b436dcc9a970e1..08249bc00bb022333d5355a30678189f6d906c53 100644 (file)
@@ -2,7 +2,7 @@
  * demux.c: demux functions for dvdplay.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.7 2003/09/07 22:49:05 fenrir Exp $
+ * $Id: demux.c,v 1.8 2004/03/03 20:39:51 gbazin Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -92,7 +92,7 @@ int E_(InitDVD) ( vlc_object_t *p_this )
     }
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index 073c615551e647e2e16a4dddb0fac84de0d87789..2f206dcad4bf7255c87a3109f5bc7e1eeac74ea8 100644 (file)
@@ -6,7 +6,7 @@
  * It depends on: libdvdread for ifo files and block reading.
  *****************************************************************************
  * Copyright (C) 2001, 2003 VideoLAN
- * $Id: input.c,v 1.23 2003/09/07 22:49:05 fenrir Exp $
+ * $Id: input.c,v 1.24 2004/03/03 20:39:51 gbazin Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -121,7 +121,7 @@ int E_(InitDVD) ( vlc_object_t *p_this )
     }
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index ad2ed56ae1f6e69c0654d00c510d2a67de5aafa1..a835fb051388777d2920f40c27038dd64b847bca 100644 (file)
@@ -2,7 +2,7 @@
  * demux.c: demux functions for dvdplay.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: demux.c,v 1.3 2003/12/05 04:24:47 rocky Exp $
+ * $Id: demux.c,v 1.4 2004/03/03 20:39:51 gbazin Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -95,7 +95,7 @@ int E_(InitVCD) ( vlc_object_t *p_this )
     }
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index 5192b7ec23a8a83f31e38a543756dda4778d88ff..b3249ca6626968c7d00d7df7dd877409912eebb8 100644 (file)
@@ -2,7 +2,7 @@
  * udp.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: udp.c,v 1.22 2004/03/03 10:51:55 massiot Exp $
+ * $Id: udp.c,v 1.23 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -203,7 +203,7 @@ static int Open( vlc_object_t *p_this )
         socket_desc.i_ttl = atoi( psz_val );
     }
     p_sys->p_thread->p_private = (void*)&socket_desc;
-    if( !( p_network = module_Need( p_sys->p_thread, "network", "" ) ) )
+    if( !( p_network = module_Need( p_sys->p_thread, "network", NULL, 0 ) ) )
     {
         msg_Err( p_access, "failed to open a connection (udp)" );
         return VLC_EGENERIC;
index 8a682f904ec14afee6dd50578d24121dafb2a628..94fddea920c3e7cebf1e6a518b002ad26f9a863f 100644 (file)
@@ -2,7 +2,7 @@
  * coreaudio.c resampler based on CoreAudio's AudioConverter
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: coreaudio.c,v 1.4 2003/05/11 01:00:26 massiot Exp $
+ * $Id: coreaudio.c,v 1.5 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -168,7 +168,7 @@ static int Create( vlc_object_t *p_this )
             sizeof(audio_sample_format_t) );
     p_sys->p_secondary_resampler->p_module
         = module_Need( p_sys->p_secondary_resampler, "audio filter",
-                       "ugly_resampler" );
+                       "ugly_resampler", VLC_TRUE );
     if ( p_sys->p_secondary_resampler->p_module == NULL )
     {
         vlc_object_detach( p_sys->p_secondary_resampler );
index 7a257f772f86ed28c644b6e08af36a5960e39c37..73f83e35265cd89d44164bea5df865e45542e293 100644 (file)
@@ -2,7 +2,7 @@
  * a52.c : raw A/52 stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.7 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: a52.c,v 1.8 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -165,7 +165,7 @@ static int Open( vlc_object_t * p_this )
                     VLC_FOURCC( 'a', '5', '2', ' ' ) );
 
     p_sys->p_packetizer->p_module =
-        module_Need( p_sys->p_packetizer, "packetizer", NULL );
+        module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
     if( !p_sys->p_packetizer->p_module )
     {
         msg_Err( p_demux, "cannot find A52 packetizer" );
index e776fcace3caaf1d35f88dcc6bae40bb505bf854..0e41b0d44fc3f22b86eb200e2475c832960fe079 100644 (file)
@@ -2,7 +2,7 @@
  * aac.c : Raw aac Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: aac.c,v 1.10 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: aac.c,v 1.11 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -126,7 +126,7 @@ static int Open( vlc_object_t * p_this )
     }
 
     /* skip possible id3 header */
-    if( ( p_id3 = module_Need( p_demux, "id3", NULL ) ) )
+    if( ( p_id3 = module_Need( p_demux, "id3", NULL, 0 ) ) )
     {
         module_Unneed( p_demux, p_id3 );
     }
index 16ef02c68535d8f87406e5b56f3e006cf73b5ba7..36ce333ee4518e0e6824798d134399a47914d28d 100644 (file)
@@ -2,7 +2,7 @@
  * demuxstream.c: Read an MPEG stream from the satellite and stream it
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: demuxstream.c,v 1.2 2004/01/25 20:05:28 hartman Exp $
+ * $Id: demuxstream.c,v 1.3 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Henri Fallon <henri@via.ecp.fr>
  *          Johan Bilien <jobi@via.ecp.fr>
@@ -217,8 +217,7 @@ static int Activate( vlc_object_t * p_this )
     socket_desc.i_bind_port     = 0;
     socket_desc.i_ttl           = 0;
     p_input->p_private = (void*)&socket_desc;
-    if( !( p_network = module_Need( p_input,
-                                    "network", "" ) ) )
+    if( !( p_network = module_Need( p_input, "network", NULL, 0 ) ) )
     {
         msg_Err( p_input, "failed to open a connection (udp)" );
         return( VLC_EGENERIC );
@@ -269,7 +268,7 @@ static int Activate( vlc_object_t * p_this )
     p_demux->i_handle = socket_desc.i_handle;
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index 3e20ec8446201880d0b45d390e285285fde41a3f..15d0b14c7188cfa97fa76ae0c9d8bca7c9385116 100644 (file)
@@ -2,7 +2,7 @@
  * dts.c : raw DTS stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: dts.c,v 1.11 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: dts.c,v 1.12 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -173,7 +173,7 @@ static int Open( vlc_object_t * p_this )
                     VLC_FOURCC( 'd', 't', 's', ' ' ) );
 
     p_sys->p_packetizer->p_module =
-        module_Need( p_sys->p_packetizer, "packetizer", NULL );
+        module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
     if( !p_sys->p_packetizer->p_module )
     {
         msg_Err( p_demux, "cannot find DTS packetizer" );
index a041d781119a852604460d73f5990ba3e720e6c2..8bd7a1cef27bf508029c9647a3607b025a915ccc 100644 (file)
@@ -2,7 +2,7 @@
  * flac.c : FLAC demux module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: flac.c,v 1.12 2004/03/03 11:40:19 fenrir Exp $
+ * $Id: flac.c,v 1.13 2004/03/03 20:39:51 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -136,7 +136,7 @@ static int Open( vlc_object_t * p_this )
             STREAMINFO_SIZE + 4 );
 
     p_sys->p_packetizer->p_module =
-        module_Need( p_sys->p_packetizer, "packetizer", NULL );
+        module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
     if( !p_sys->p_packetizer->p_module )
     {
         if( p_sys->p_packetizer->fmt_in.p_extra )
index ab756055da760ead7b6f3a7358ab98d9f1bd1a52..c08a4a8ffda68f6b5c7c4261819414b54b8d499f 100644 (file)
@@ -2,7 +2,7 @@
  * m4v.c : MPEG-4 Video demuxer
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: m4v.c,v 1.11 2003/12/22 02:24:52 sam Exp $
+ * $Id: m4v.c,v 1.12 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -122,10 +122,11 @@ static int Open( vlc_object_t * p_this )
     p_sys->p_packetizer->pf_decode_video = NULL;
     p_sys->p_packetizer->pf_decode_sub = NULL;
     p_sys->p_packetizer->pf_packetize = NULL;
-    es_format_Init( &p_sys->p_packetizer->fmt_in,  VIDEO_ES,   VLC_FOURCC( 'm', 'p', '4', 'v' ) );
+    es_format_Init( &p_sys->p_packetizer->fmt_in, VIDEO_ES,
+                    VLC_FOURCC( 'm', 'p', '4', 'v' ) );
     es_format_Init( &p_sys->p_packetizer->fmt_out, UNKNOWN_ES, 0 );
     p_sys->p_packetizer->p_module =
-        module_Need( p_sys->p_packetizer, "packetizer", NULL );
+        module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
 
     if( p_sys->p_packetizer->p_module == NULL)
     {
index 13fb08ce9969d078338d3e8fcfae6754b194df22..0a4db1671f7275c5c73142dc970b004ccde0e0da 100644 (file)
@@ -2,7 +2,7 @@
  * mpga.c : MPEG-I/II Audio input module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2004 VideoLAN
- * $Id: mpga.c,v 1.17 2004/03/03 11:41:04 fenrir Exp $
+ * $Id: mpga.c,v 1.18 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -166,7 +166,7 @@ static int Open( vlc_object_t * p_this )
     }
 
     /* skip possible id3 header */
-    if( ( p_id3 = module_Need( p_demux, "id3", NULL ) ) )
+    if( ( p_id3 = module_Need( p_demux, "id3", NULL, 0 ) ) )
     {
         module_Unneed( p_demux, p_id3 );
     }
index ccd7a5dd8d11dd39a22438368562cd793a4aec3c..e75a4d04cc1439f4311f424b20198e08686ee334 100644 (file)
@@ -2,7 +2,7 @@
  * mpgv.c : MPEG-I/II Video demuxer
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: mpgv.c,v 1.5 2004/01/25 20:05:28 hartman Exp $
+ * $Id: mpgv.c,v 1.6 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -135,10 +135,11 @@ static int Open( vlc_object_t * p_this )
     p_sys->p_packetizer->pf_decode_video = NULL;
     p_sys->p_packetizer->pf_decode_sub = NULL;
     p_sys->p_packetizer->pf_packetize = NULL;
-    es_format_Init( &p_sys->p_packetizer->fmt_in,  VIDEO_ES,   VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
+    es_format_Init( &p_sys->p_packetizer->fmt_in, VIDEO_ES,
+                    VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
     es_format_Init( &p_sys->p_packetizer->fmt_out, UNKNOWN_ES, 0 );
     p_sys->p_packetizer->p_module =
-        module_Need( p_sys->p_packetizer, "packetizer", NULL );
+        module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
 
     if( p_sys->p_packetizer->p_module == NULL)
     {
index 8522fbee2da71a051a8acdfc5a983fa2ddfa5e90..949f194f535d3747d4eaabe4db12be9897792d60 100644 (file)
@@ -2,7 +2,7 @@
  * ps.c : Program Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2004, 2004 VideoLAN
- * $Id: ps.c,v 1.17 2004/01/25 20:05:28 hartman Exp $
+ * $Id: ps.c,v 1.18 2004/03/03 20:39:52 gbazin Exp $
  *
  * Author: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -123,7 +123,7 @@ static int Activate( vlc_object_t * p_this )
     }
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index b1fdd02485f657a0a6e75bb2427ecccf7b538f04..d0883de66613412681e9e60815164640444c394b 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ts.c : Transport Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2004 VideoLAN
- * $Id: ts.c,v 1.46 2004/01/25 20:05:28 hartman Exp $
+ * $Id: ts.c,v 1.47 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Henri Fallon <henri@via.ecp.fr>
  *          Johan Bilien <jobi@via.ecp.fr>
@@ -230,7 +230,7 @@ static int Activate( vlc_object_t * p_this )
     }
 
     p_input->p_private = (void*)&p_demux->mpeg;
-    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL );
+    p_demux->p_module = module_Need( p_input, "mpeg-system", NULL, 0 );
     if( p_demux->p_module == NULL )
     {
         free( p_input->p_demux_data );
index b8c0f284c0913476a86f41d70f89c3a03c7b0228..c5a7ccb372f92486ab02073e2884978863061ea0 100644 (file)
@@ -2,7 +2,7 @@
  * sub.h
  *****************************************************************************
  * Copyright (C) 2001-2004 VideoLAN
- * $Id: sub.h,v 1.19 2004/01/27 13:10:29 fenrir Exp $
+ * $Id: sub.h,v 1.20 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -91,7 +91,7 @@ static inline subtitle_demux_t *subtitle_New( input_thread_t *p_input,
     p_sub = vlc_object_create( p_input, sizeof( subtitle_demux_t ) );
     p_sub->psz_object_name = "subtitle demux";
     vlc_object_attach( p_sub, p_input );
-    p_sub->p_module = module_Need( p_sub, "subtitle demux", "" );
+    p_sub->p_module = module_Need( p_sub, "subtitle demux", NULL, 0 );
 
     if( p_sub->p_module &&
         p_sub->pf_open( p_sub, p_input, psz_name, i_microsecperframe ) >=0 )
index d66665244d3af649cd05541775389e61bb9b1050..f93aba3fc7fa09d7c0afef37f76a755f3dc01dbd 100644 (file)
@@ -2,7 +2,7 @@
  * gnome.c : Gnome plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.17 2004/01/25 18:53:07 gbazin Exp $
+ * $Id: gnome.c,v 1.18 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -98,7 +98,8 @@ static int Open( vlc_object_t *p_this )
         return VLC_ENOMEM;
     }
 
-    p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gnome" );
+    p_intf->p_sys->p_gtk_main =
+        module_Need( p_this, "gui-helper", "gnome", VLC_TRUE );
     if( p_intf->p_sys->p_gtk_main == NULL )
     {
         free( p_intf->p_sys );
index f0e20e22fdc5534ab2d34e7e32c286c467e4098f..05dcba555b7d098a3026a6dab380522bd4666224 100644 (file)
@@ -2,7 +2,7 @@
  * gtk.c : Gtk+ plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.22 2004/01/25 18:53:07 gbazin Exp $
+ * $Id: gtk.c,v 1.23 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -97,7 +97,8 @@ static int Open( vlc_object_t *p_this )
     }
 
 #ifdef NEED_GTK_MAIN
-    p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk" );
+    p_intf->p_sys->p_gtk_main =
+        module_Need( p_this, "gui-helper", "gtk", VLC_TRUE );
     if( p_intf->p_sys->p_gtk_main == NULL )
     {
         free( p_intf->p_sys );
index fde1b75244faea2cf271263c2012c61b066d7ca6..e580916f94ac222b1049c1d0adf2a1a2b9f7c67e 100644 (file)
@@ -2,7 +2,7 @@
  * gnome2.c : GNOME 2 plugin for vlc
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gnome2.c,v 1.2 2003/03/30 18:14:37 gbazin Exp $
+ * $Id: gnome2.c,v 1.3 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -83,7 +83,8 @@ static int Open( vlc_object_t *p_this )
     }
 
 #ifdef NEED_GTK2_MAIN
-    p_intf->p_sys->p_gui_helper = module_Need( p_this, "gui-helper", "gnome2" );
+    p_intf->p_sys->p_gui_helper =
+        module_Need( p_this, "gui-helper", "gnome2", VLC_TRUE );
     if( p_intf->p_sys->p_gui_helper == NULL )
     {
         free( p_intf->p_sys );
index ff059634be9ac9af150c5b47222c1a657f7a6c0a..40d7993d367cdebf5060ded0ff235de19365f9e0 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2.c : Gtk2 plugin for vlc
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2.c,v 1.2 2003/03/30 18:14:37 gbazin Exp $
+ * $Id: gtk2.c,v 1.3 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -84,7 +84,8 @@ static int Open( vlc_object_t *p_this )
     }
 
 #ifdef NEED_GTK2_MAIN
-    p_intf->p_sys->p_gui_helper = module_Need( p_this, "gui-helper", "gtk2" );
+    p_intf->p_sys->p_gui_helper =
+        module_Need( p_this, "gui-helper", "gtk2", VLC_TRUE );
     if( p_intf->p_sys->p_gui_helper == NULL )
     {
         free( p_intf->p_sys );
index 449fcfbb4f1ad6e5a4118c2dee12e2c84103b2cb..bc4a8003face5499900f858802326e670de4abf8 100644 (file)
@@ -2,7 +2,7 @@
  * pda.c : PDA Gtk2 plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: pda.c,v 1.22 2004/02/29 22:59:59 jpsaman Exp $
+ * $Id: pda.c,v 1.23 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *          Marc Ariberti <marcari@videolan.org>
@@ -87,7 +87,8 @@ static int Open( vlc_object_t *p_this )
 
 #ifdef NEED_GTK2_MAIN
     msg_Dbg( p_intf, "Using gui-helper" );
-    p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk2" );
+    p_intf->p_sys->p_gtk_main =
+        module_Need( p_this, "gui-helper", "gtk2", VLC_TRUE );
     if( p_intf->p_sys->p_gtk_main == NULL )
     {
         free( p_intf->p_sys );
index fc0f85328fc8ad697487668305b4aa260486c895..931482de05496a77ca6ba158998f9be886407631 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp: Handles all the different dialog boxes we provide.
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: dialogs.cpp,v 1.17 2003/12/11 02:26:03 asmax Exp $
+ * $Id: dialogs.cpp,v 1.18 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -63,7 +63,7 @@ Dialogs::Dialogs( intf_thread_t *_p_intf )
         return;
     }
 
-    p_module = module_Need( p_provider, "dialogs provider", NULL );
+    p_module = module_Need( p_provider, "dialogs provider", NULL, 0 );
     if( p_module == NULL )
     {
         msg_Err( p_intf, "no suitable dialogs provider found" );
index 572cac1f2c3e3e41923770b4d16c99d8e3894bbf..31408d6e9e9316302bc6d725133436bd1fa43027 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: dialogs.cpp,v 1.2 2004/01/25 17:20:19 kuehne Exp $
+ * $Id: dialogs.cpp,v 1.3 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -132,7 +132,7 @@ bool Dialogs::init()
         return false;
     }
 
-    m_pModule = module_Need( m_pProvider, "dialogs provider", NULL );
+    m_pModule = module_Need( m_pProvider, "dialogs provider", NULL, 0 );
     if( m_pModule == NULL )
     {
         msg_Err( getIntf(), "No suitable dialogs provider found" );
index 48c479085fbe5ba9cf9bf010eff1f343934224a8..db8cbab14b2e82983fed2d46aa993ecaa677a2af 100644 (file)
@@ -2,7 +2,7 @@
  * sap.c :  SAP interface module
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: sap.c,v 1.53 2004/02/23 21:00:37 sigmunau Exp $
+ * $Id: sap.c,v 1.54 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Arnaud Schauly <gitan@via.ecp.fr>
  *          Clément Stenac <zorglub@via.ecp.fr>
@@ -263,7 +263,7 @@ static int Open( vlc_object_t *p_this )
         sock.i_ttl             = 0;
         p_intf->p_private = (void*) &sock;
 
-        p_network = module_Need( p_intf, "network", "ipv4" );
+        p_network = module_Need( p_intf, "network", "ipv4", VLC_TRUE );
         if( p_network )
         {
             p_sys->fd[0] = sock.i_handle;
@@ -299,7 +299,7 @@ static int Open( vlc_object_t *p_this )
         sock.i_ttl             = 0;
         p_intf->p_private = (void*) &sock;
 
-        p_network = module_Need( p_intf, "network", "ipv6" );
+        p_network = module_Need( p_intf, "network", "ipv6", VLC_TRUE );
         if( p_network )
         {
             p_sys->fd[1] = sock.i_handle;
index f42d8ce6831605dc93e0a7a2bb8b7484802439ef..663ffc3ab1efd3fb56b1cfda812f7d1b60760a9b 100644 (file)
@@ -220,7 +220,7 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout,
 
         /* Call the network module */
         p_sout->p_private = (void*) &socket_desc;
-        if( !( p_network = module_Need( p_sout, "network", "ipv4" ) ) )
+        if( !( p_network = module_Need(p_sout, "network", "ipv4", VLC_TRUE) ) )
         {
              msg_Warn( p_sout, "failed to open a connection (udp)" );
              return NULL;
@@ -260,7 +260,7 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout,
 
         /* Call the network module */
         p_sout->p_private = (void *) &socket_desc;
-        if( !( p_network = module_Need( p_sout, "network", "ipv6" ) ) )
+        if( !( p_network = module_Need(p_sout, "network", "ipv6", VLC_TRUE) ) )
         {
             msg_Warn( p_sout, "failed to open a connection (udp)" );
             return NULL;
index e98fcd9bfc0aaa2830666ac725f4180db0bde8c3..1f59e4e5c3fa4c9851873e7f564c5d5dc2045df9 100644 (file)
@@ -2,7 +2,7 @@
  * transcode.c: transcoding stream output module
  *****************************************************************************
  * Copyright (C) 2003-2004 VideoLAN
- * $Id: transcode.c,v 1.81 2004/03/03 11:29:26 massiot Exp $
+ * $Id: transcode.c,v 1.82 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -786,7 +786,7 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
     id->p_encoder->fmt_out.i_bitrate = id->f_dst.i_bitrate;
 
     id->p_encoder->p_module =
-        module_Need( id->p_encoder, "encoder", NULL );
+        module_Need( id->p_encoder, "encoder", NULL, 0 );
     if( !id->p_encoder->p_module )
     {
         vlc_object_destroy( id->p_encoder );
@@ -1178,7 +1178,7 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
     id->p_vresample      = NULL;
 
     id->p_encoder->p_module =
-        module_Need( id->p_encoder, "encoder", NULL );
+        module_Need( id->p_encoder, "encoder", NULL, 0 );
 
     if( !id->p_encoder->p_module )
     {
@@ -1375,7 +1375,7 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
             id->p_encoder->fmt_out.p_extra = NULL;
 
             id->p_encoder->p_module =
-                module_Need( id->p_encoder, "encoder", NULL );
+                module_Need( id->p_encoder, "encoder", NULL, 0 );
             if( !id->p_encoder->p_module )
             {
                 vlc_object_destroy( id->p_encoder );
index 96ecc6c4479c9050a007468341e2e187507f9729..1be40e803ed836e56f9e6a9253e189ed229289f1 100644 (file)
@@ -2,7 +2,7 @@
  * qte.cpp : QT Embedded plugin for vlc
  *****************************************************************************
  * Copyright (C) 1998-2003 VideoLAN
- * $Id: qte.cpp,v 1.21 2004/01/26 16:45:02 zorglub Exp $
+ * $Id: qte.cpp,v 1.22 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Gerald Hansink <gerald.hansink@ordain.nl>
  *          Jean-Paul Saman <jpsaman@wxs.nl>
@@ -150,7 +150,8 @@ static int Open( vlc_object_t *p_this )
     p_vout->pf_display = Display;
 
 #ifdef NEED_QTE_MAIN
-    p_vout->p_sys->p_qte_main = module_Need( p_this, "gui-helper", "qte" );
+    p_vout->p_sys->p_qte_main =
+        module_Need( p_this, "gui-helper", "qte", VLC_TRUE );
     if( p_vout->p_sys->p_qte_main == NULL )
     {
         free( p_vout->p_sys );
index 3d34589f6d15975d943bca45f508d0f4909ed5b4..93d12408546ed9725222388ce97fda37ea865231 100644 (file)
@@ -2,7 +2,7 @@
  * filters.c : audio output filters management
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: filters.c,v 1.19 2004/01/06 12:02:05 zorglub Exp $
+ * $Id: filters.c,v 1.20 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -52,7 +52,7 @@ static aout_filter_t * FindFilter( aout_instance_t * p_aout,
     memcpy( &p_filter->input, p_input_format, sizeof(audio_sample_format_t) );
     memcpy( &p_filter->output, p_output_format,
             sizeof(audio_sample_format_t) );
-    p_filter->p_module = module_Need( p_filter, "audio filter", NULL );
+    p_filter->p_module = module_Need( p_filter, "audio filter", NULL, 0 );
     if ( p_filter->p_module == NULL )
     {
         vlc_object_detach( p_filter );
index e0eb882ab9511905466cb210008d33ba0277181b..1708797edd2be6a78c4805f5a99b6bddbc338520 100644 (file)
@@ -2,7 +2,7 @@
  * input.c : internal management of input streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: input.c,v 1.43 2004/01/06 12:02:05 zorglub Exp $
+ * $Id: input.c,v 1.44 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -177,7 +177,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
                     sizeof(audio_sample_format_t) );
 
             p_filter->p_module =
-                module_Need( p_filter,"audio filter", psz_parser );
+                module_Need( p_filter,"audio filter", psz_parser, VLC_TRUE );
 
             if( p_filter->p_module== NULL )
             {
@@ -527,7 +527,7 @@ static aout_filter_t * allocateUserChannelMixer( aout_instance_t * p_aout,
     memcpy( &p_channel_mixer->output, p_output_format,
                     sizeof(audio_sample_format_t) );
     p_channel_mixer->p_module =
-                    module_Need( p_channel_mixer,"audio filter", psz_name );
+        module_Need( p_channel_mixer,"audio filter", psz_name, VLC_TRUE );
     if( p_channel_mixer->p_module== NULL )
     {
         msg_Err( p_aout, "cannot add user channel mixer %s", psz_name );
index 2dd5e4ee5bab9d395ce08d97295169ae2358a847..315cf44babc52475638e3c9bdca1cc6dd9a87a2f 100644 (file)
@@ -2,7 +2,7 @@
  * mixer.c : audio output mixing operations
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: mixer.c,v 1.29 2004/01/06 12:02:05 zorglub Exp $
+ * $Id: mixer.c,v 1.30 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -43,7 +43,7 @@
  *****************************************************************************/
 int aout_MixerNew( aout_instance_t * p_aout )
 {
-    p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL );
+    p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL, 0 );
     if ( p_aout->mixer.p_module == NULL )
     {
         msg_Err( p_aout, "no suitable aout mixer" );
index 287601a6177e4d407e400a2bb765ecf1ce900aac..76ffedbb44d7cc16291b90b55681cf2bdce351d8 100644 (file)
@@ -2,7 +2,7 @@
  * output.c : internal management of output streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: output.c,v 1.43 2004/01/26 21:37:58 hartman Exp $
+ * $Id: output.c,v 1.44 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -41,7 +41,6 @@ int aout_OutputNew( aout_instance_t * p_aout,
                     audio_sample_format_t * p_format )
 {
     /* Retrieve user defaults. */
-    char * psz_name = config_GetPsz( p_aout, "aout" );
     int i_rate = config_GetInt( p_aout, "aout-rate" );
     vlc_value_t val, text;
     /* kludge to avoid a fpu error when rate is 0... */
@@ -55,8 +54,7 @@ int aout_OutputNew( aout_instance_t * p_aout,
     vlc_mutex_lock( &p_aout->output_fifo_lock );
 
     /* Find the best output plug-in. */
-    p_aout->output.p_module = module_Need( p_aout, "audio output", psz_name );
-    if ( psz_name != NULL ) free( psz_name );
+    p_aout->output.p_module = module_Need( p_aout, "audio output", "$aout", 0);
     if ( p_aout->output.p_module == NULL )
     {
         msg_Err( p_aout, "no suitable aout module" );
index 5b320255d72d8a9c3ee71c6fa064cdecc11551e2..7fc495432cd4eee7794f796f855596b74af6b8d7 100644 (file)
@@ -2,7 +2,7 @@
  * demux.c
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: demux.c,v 1.12 2004/03/03 12:01:38 fenrir Exp $
+ * $Id: demux.c,v 1.13 2004/03/03 20:39:53 gbazin Exp $
  *
  * Author: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -238,7 +238,8 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
     /* Before module_Need (for var_Create...) */
     vlc_object_attach( p_demux, p_obj );
 
-    p_demux->p_module = module_Need( p_demux, "demux2", p_demux->psz_demux );
+    p_demux->p_module =
+        module_Need( p_demux, "demux2", p_demux->psz_demux, VLC_TRUE );
     if( p_demux->p_module == NULL )
     {
         vlc_object_detach( p_demux );
index 0b66bc9fda5c1babdb0e7d1984421ef7fe09be84..3465be1ba2987a01c2dec55c0e57e5528aa8ba82 100644 (file)
@@ -4,7 +4,7 @@
  * decoders.
  *****************************************************************************
  * Copyright (C) 1998-2004 VideoLAN
- * $Id: input.c,v 1.291 2004/03/03 11:59:41 fenrir Exp $
+ * $Id: input.c,v 1.292 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -673,7 +673,7 @@ static int InitThread( input_thread_t * p_input )
 
     /* Find and open appropriate access module */
     p_input->p_access = module_Need( p_input, "access",
-                                     p_input->psz_access );
+                                     p_input->psz_access, VLC_TRUE );
 
 #ifndef WIN32      /* Remove this gross hack from the win32 build as colons
                     * are forbidden in filenames on Win32. */
@@ -688,7 +688,7 @@ static int InitThread( input_thread_t * p_input )
         p_input->psz_dupsource = NULL;
 
         p_input->p_access = module_Need( p_input, "access",
-                                         p_input->psz_access );
+                                         p_input->psz_access, VLC_TRUE );
     }
 #endif
 
@@ -778,7 +778,9 @@ static int InitThread( input_thread_t * p_input )
     p_input->p_demux =
         module_Need( p_input, "demux",
                      (p_input->psz_demux && *p_input->psz_demux) ?
-                     p_input->psz_demux : "$demux" );
+                     p_input->psz_demux : "$demux",
+                     (p_input->psz_demux && *p_input->psz_demux) ?
+                     VLC_TRUE : VLC_FALSE );
 
     if( p_input->p_demux == NULL )
     {
index ca5b6921be06310f841d38d6e50ef12f0bf11af9..4c80c32ec39ab566ec0f1cb8008394dc14d236b9 100644 (file)
@@ -2,7 +2,7 @@
  * input_dec.c: Functions for the management of decoders
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: input_dec.c,v 1.93 2004/03/03 11:12:08 massiot Exp $
+ * $Id: input_dec.c,v 1.94 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -106,7 +106,7 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
             return NULL;
         }
 
-        p_dec->p_module = module_Need( p_dec, "packetizer", "$packetizer" );
+        p_dec->p_module = module_Need( p_dec, "packetizer", "$packetizer", 0 );
     }
     else
     {
@@ -119,7 +119,7 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
         }
 
         /* default Get a suitable decoder module */
-        p_dec->p_module = module_Need( p_dec, "decoder", "$codec" );
+        p_dec->p_module = module_Need( p_dec, "decoder", "$codec", 0 );
     }
 
     if( !p_dec->p_module )
index 848a8d02ddfd5c57844c6838567df27b111a9a26..1344a4c1c6a83a1babb09b06f4e90383b40dcaf6 100644 (file)
@@ -4,7 +4,7 @@
  * interface, such as command line.
  *****************************************************************************
  * Copyright (C) 1998-2004 VideoLAN
- * $Id: interface.c,v 1.113 2004/02/08 11:23:17 gbazin Exp $
+ * $Id: interface.c,v 1.114 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -98,7 +98,7 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module )
     }
 
     /* Choose the best module */
-    p_intf->p_module = module_Need( p_intf, "interface", psz_module );
+    p_intf->p_module = module_Need( p_intf, "interface", psz_module, 0 );
 
     if( p_intf->p_module == NULL )
     {
@@ -296,7 +296,7 @@ static void RunInterface( intf_thread_t *p_intf )
         /* Make sure the old interface is completely uninitialised */
         module_Unneed( p_intf, p_intf->p_module );
 
-        p_intf->p_module = module_Need( p_intf, "interface", psz_intf );
+        p_intf->p_module = module_Need( p_intf, "interface", psz_intf, 0 );
         free( psz_intf );
 
         if( p_intf->p_module )
index 3a6ea1a466c00f59cf223abd87ec4f804a879740..ffb926c98e11ea77678aa8433d9504de2c7ebbf6 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.c: main libvlc source
  *****************************************************************************
  * Copyright (C) 1998-2004 VideoLAN
- * $Id: libvlc.c,v 1.117 2004/02/22 15:41:27 massiot Exp $
+ * $Id: libvlc.c,v 1.118 2004/03/03 20:39:52 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -559,7 +559,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     /*
      * Choose the best memcpy module
      */
-    p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", "$memcpy" );
+    p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", "$memcpy", 0 );
 
     if( p_vlc->pf_memcpy == NULL )
     {
index 901f3e1f6fab1e6f03f678fb4d0bbcf87e0b9e86..b2600fbff98cbb47ef010716335ff66f0818cb8a 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001-2004 VideoLAN
- * $Id: modules.c,v 1.145 2004/03/03 15:47:08 sigmunau Exp $
+ * $Id: modules.c,v 1.146 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Sam Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -262,7 +262,7 @@ void __module_LoadPlugins( vlc_object_t * p_this )
  * This function returns the module that best fits the asked capabilities.
  *****************************************************************************/
 module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
-                          const char *psz_name )
+                          const char *psz_name, vlc_bool_t b_strict )
 {
     typedef struct module_list_t module_list_t;
 
@@ -299,7 +299,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
     /* Count how many different shortcuts were asked for */
     if( psz_name && *psz_name )
     {
-        char *psz_parser;
+        char *psz_parser, *psz_last_shortcut;
 
         /* If the user wants none, give him none. */
         if( !strcmp( psz_name, "none" ) )
@@ -309,7 +309,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
         }
 
         i_shortcuts++;
-        psz_shortcuts = strdup( psz_name );
+        psz_shortcuts = psz_last_shortcut = strdup( psz_name );
 
         for( psz_parser = psz_shortcuts; *psz_parser; psz_parser++ )
         {
@@ -317,8 +317,16 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
             {
                  *psz_parser = '\0';
                  i_shortcuts++;
+                 psz_last_shortcut = psz_parser + 1;
             }
         }
+
+        /* Check if the user wants to override the "strict" mode */
+        if( psz_last_shortcut )
+        {
+            if( !strcmp(psz_last_shortcut, "none") ) b_strict = VLC_TRUE;
+            else if( !strcmp(psz_last_shortcut, "any") ) b_strict = VLC_FALSE;
+        }
     }
 
     /* Sort the modules and test them */
@@ -377,10 +385,10 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
 
             while( i_short )
             {
-                /* If the last given shortcut is "none" and we couldn't
+                /* If we are in "strict" mode 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") )
+                if( i_short == 1 && b_strict )
                 {
                     b_trash = VLC_TRUE;
                     break;
index 1883d6e0050e5540f6c111a40fc1f6f6b2e8eb51..a04a6ade1bb92f8dcb340c9098bd488c371ac213 100644 (file)
@@ -2,7 +2,7 @@
  * net.c:
  *****************************************************************************
  * Copyright (C) 2004 VideoLAN
- * $Id: net.c,v 1.9 2004/01/25 17:16:06 zorglub Exp $
+ * $Id: net.c,v 1.10 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@videolan.org>
  *
@@ -72,7 +72,6 @@ int __net_OpenTCP( vlc_object_t *p_this, char *psz_host, int i_port )
     network_socket_t sock;
     module_t         *p_network;
 
-
     /* Check if we have force ipv4 or ipv6 */
     var_Create( p_this, "ipv4", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     var_Get( p_this, "ipv4", &val );
@@ -99,9 +98,10 @@ int __net_OpenTCP( vlc_object_t *p_this, char *psz_host, int i_port )
     msg_Dbg( p_this, "net: connecting to '%s:%d'", psz_host, i_port );
     private = p_this->p_private;
     p_this->p_private = (void*)&sock;
-    if( ( p_network = module_Need( p_this, "network", psz_network ) ) == NULL )
+    if( !( p_network = module_Need( p_this, "network", psz_network, 0 ) ) )
     {
-        msg_Dbg( p_this, "net: connection to '%s:%d' failed", psz_host, i_port );
+        msg_Dbg( p_this, "net: connection to '%s:%d' failed",
+                 psz_host, i_port );
         return -1;
     }
     module_Unneed( p_this, p_network );
@@ -155,7 +155,7 @@ int __net_OpenUDP( vlc_object_t *p_this, char *psz_bind, int i_bind,
              psz_server, i_server, psz_bind, i_bind );
     private = p_this->p_private;
     p_this->p_private = (void*)&sock;
-    if( ( p_network = module_Need( p_this, "network", psz_network ) ) == NULL )
+    if( !( p_network = module_Need( p_this, "network", psz_network, 0 ) ) )
     {
         msg_Dbg( p_this, "net: connection to '%s:%d@%s:%d' failed",
                  psz_server, i_server, psz_bind, i_bind );
index d85defcd654141be581685bd80c320f88765ee12..52596af765e62f59a8d9b2b65077c4ed7e8b1f4c 100644 (file)
@@ -2,7 +2,7 @@
  * loadsave.c : Playlist loading / saving functions
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: loadsave.c,v 1.10 2004/01/29 17:51:08 zorglub Exp $
+ * $Id: loadsave.c,v 1.11 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -113,7 +113,7 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename ,
     vlc_mutex_lock( &p_playlist->object_lock );
 
     /* And call the module ! All work is done now */
-    p_module = module_Need( p_playlist, "playlist export",  psz_type);
+    p_module = module_Need( p_playlist, "playlist export", psz_type, VLC_TRUE);
     if( !p_module )
     {
         msg_Warn( p_playlist, "failed to export playlist" );
index 650764e839650ba3fc3ca59828b1bc38deda6f42..dd6f3db6dd5ca7ae05a801203e8fec4b550a1675 100644 (file)
@@ -2,7 +2,7 @@
  * stream_output.c : stream output module
  *****************************************************************************
  * Copyright (C) 2002-2004 VideoLAN
- * $Id: stream_output.c,v 1.40 2004/02/22 16:08:47 fenrir Exp $
+ * $Id: stream_output.c,v 1.41 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -42,9 +42,6 @@ static void sout_cfg_free( sout_cfg_t * );
 #define sout_stream_url_to_chain( p, s ) _sout_stream_url_to_chain( VLC_OBJECT(p), s )
 static char *_sout_stream_url_to_chain( vlc_object_t *, char * );
 
-#define module_NeedStrict(a,b,c) __module_NeedStrict(VLC_OBJECT(a),b,c)
-static module_t *__module_NeedStrict( vlc_object_t *, const char *, const char * );
-
 /*
  * Generic MRL parser
  *
@@ -282,7 +279,7 @@ sout_access_out_t *sout_AccessOutNew( sout_instance_t *p_sout,
     p_access->pf_write   = NULL;
 
     p_access->p_module   =
-        module_NeedStrict( p_access, "sout access", p_access->psz_access );
+        module_Need( p_access, "sout access", p_access->psz_access, VLC_TRUE );
 
     if( !p_access->p_module )
     {
@@ -373,7 +370,7 @@ sout_mux_t * sout_MuxNew         ( sout_instance_t *p_sout,
     p_mux->p_sys        = NULL;
 
     p_mux->p_module     =
-        module_NeedStrict( p_mux, "sout mux", p_mux->psz_mux );
+        module_Need( p_mux, "sout mux", p_mux->psz_mux, VLC_TRUE );
 
     if( p_mux->p_module == NULL )
     {
@@ -1213,7 +1210,7 @@ sout_stream_t *sout_stream_new( sout_instance_t *p_sout,
     msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
 
     p_stream->p_module =
-        module_NeedStrict( p_stream, "sout stream", p_stream->psz_name );
+        module_Need( p_stream, "sout stream", p_stream->psz_name, VLC_TRUE );
 
     if( !p_stream->p_module )
     {
@@ -1263,28 +1260,3 @@ static char *_sout_stream_url_to_chain( vlc_object_t *p_this, char *psz_url )
     mrl_Clean( &mrl );
     return( psz_chain );
 }
-
-/*****************************************************************************/
-static module_t *__module_NeedStrict( vlc_object_t *p_obj, const char *psz_capacity, const char *psz_name )
-{
-    module_t *p_module;
-
-    if( !psz_name || !*psz_name )
-    {
-        p_module = module_Need( p_obj, psz_capacity, psz_name );
-    }
-    else
-    {
-        char *psz_name_strict = malloc( strlen( psz_name ) + 6 );
-        strcpy( psz_name_strict, psz_name );
-        strcat( psz_name_strict, ",none" );
-
-        p_module = module_Need( p_obj, psz_capacity, psz_name_strict );
-
-        free( psz_name_strict );
-    }
-
-    return p_module;
-}
-
-
index b8e2031390f5a871433eb80fb4dbe7208c084f77..13847492ebb0e33051a94a2c7ae19ff9054b1fec 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2004 VideoLAN
- * $Id: video_output.c,v 1.245 2004/01/25 17:16:06 zorglub Exp $
+ * $Id: video_output.c,v 1.246 2004/03/03 20:39:53 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -403,10 +403,8 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
 
     /* Create the vout thread */
     p_vout->p_module = module_Need( p_vout,
-                           ( p_vout->psz_filter_chain &&
-                               *p_vout->psz_filter_chain ) ?
-                           "video filter" : "video output",
-                           psz_plugin );
+        ( p_vout->psz_filter_chain && *p_vout->psz_filter_chain ) ?
+        "video filter" : "video output", psz_plugin, 0 );
 
     if( psz_plugin ) free( psz_plugin );
     if( p_vout->p_module == NULL )
@@ -416,8 +414,8 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
         return NULL;
     }
 
-    p_vout->p_text_renderer_module = module_Need( p_vout, "text renderer",
-                                                  NULL );
+    p_vout->p_text_renderer_module =
+        module_Need( p_vout, "text renderer", NULL, 0 );
     if( p_vout->p_text_renderer_module == NULL )
     {
         msg_Warn( p_vout, "no suitable text renderer module" );
@@ -669,7 +667,7 @@ static int InitThread( vout_thread_t *p_vout )
         p_vout->b_direct = 0;
 
         /* Choose the best module */
-        p_vout->chroma.p_module = module_Need( p_vout, "chroma", NULL );
+        p_vout->chroma.p_module = module_Need( p_vout, "chroma", NULL, 0 );
 
         if( p_vout->chroma.p_module == NULL )
         {