From: Pierre d'Herbemont Date: Thu, 10 Dec 2009 22:05:27 +0000 (+0100) Subject: libvlc: don't abort but return an error code if no modules were found. X-Git-Tag: 1.1.0-ff~2031 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=808e8fb5910f16b91c02cc36b236f2a5c52d5949;p=vlc libvlc: don't abort but return an error code if no modules were found. Also, let the possibility to run vlc -H. Pointed-out-by RĂ©mi Denis-Courmont . --- 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 );