From 808e8fb5910f16b91c02cc36b236f2a5c52d5949 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Thu, 10 Dec 2009 23:05:27 +0100 Subject: [PATCH] libvlc: don't abort but return an error code if no modules were found. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also, let the possibility to run vlc -H. Pointed-out-by Rémi Denis-Courmont . --- src/libvlc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libvlc.c b/src/libvlc.c index 3cef1bfa00..aa512d2b23 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -475,12 +475,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, module_list_free( list ); msg_Dbg( p_libvlc, "module bank initialized (%zu modules)", module_count ); - if( module_count <= 1) - { - msg_Err( p_libvlc, "No modules were found, refusing to start. Check " - "that you properly gave a module path with --plugin-path."); - abort(); - } /* Check for help on modules */ if( (p_tmp = var_CreateGetNonEmptyString( p_libvlc, "module" )) ) { @@ -536,6 +530,14 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, } } + if( module_count <= 1) + { + msg_Err( p_libvlc, "No modules were found, refusing to start. Check " + "that you properly gave a module path with --plugin-path."); + b_exit = true; + i_ret = VLC_ENOITEM; + } + if( b_exit ) { module_EndBank( p_libvlc, true ); -- 2.39.2