]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
libvlc: don't abort but return an error code if no modules were found.
[vlc] / 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 );