]> git.sesse.net Git - vlc/commitdiff
libvlc: don't abort but return an error code if no modules were found.
authorPierre d'Herbemont <pdherbemont@free.fr>
Thu, 10 Dec 2009 22:05:27 +0000 (23:05 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Thu, 10 Dec 2009 22:06:33 +0000 (23:06 +0100)
Also, let the possibility to run vlc -H.

Pointed-out-by RĂ©mi Denis-Courmont <remi@remlab.net>.

src/libvlc.c

index 3cef1bfa00e178a600ce07a47dcec211fd458503..aa512d2b238558d5bd74fc9672aec2d355e9685c 100644 (file)
@@ -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 );