]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
Add vlc_GetActionId().
[vlc] / src / libvlc.c
index 3cef1bfa00e178a600ce07a47dcec211fd458503..a6e6b69cbf11778994293ed524cc1ea9759cb252 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 );
@@ -815,7 +817,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         struct hotkey *p_keys =
             malloc( (libvlc_actions_count + 1) * sizeof (*p_keys) );
 
-       /* Initialize from configuration */
+        /* Initialize from configuration */
         for( size_t i = 0; i < libvlc_actions_count; i++ )
         {
             p_keys[i].psz_action = libvlc_actions[i].name;
@@ -1243,7 +1245,7 @@ static inline int LoadMessages (void)
 #else
     char psz_path[1024];
     if (snprintf (psz_path, sizeof (psz_path), "%s" DIR_SEP "%s",
-                  config_GetDataDir(), "locale")
+                  config_GetDataDirDefault(), "locale")
                      >= (int)sizeof (psz_path))
         return -1;
 
@@ -1918,6 +1920,10 @@ static void ListModules( libvlc_int_t *p_this, bool b_verbose )
 
 #ifdef WIN32
     ShowConsole( true );
+    b_color = false; // don't put color control codes in a .txt file
+#else
+    if( !isatty( 1 ) )
+        b_color = false;
 #endif
 
     /* List all modules */