]> git.sesse.net Git - vlc/blobdiff - bin/vlc.c
Win32: file description shouldn't have the version number
[vlc] / bin / vlc.c
index 9bc0dad66bd7226c1e8f82389ec35ca629f3f961..2e133345e44f2a53dfb6b18d4b078da055c6ac09 100644 (file)
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vlc.c: the VLC player
  *****************************************************************************
- * Copyright (C) 1998-2008 the VideoLAN team
+ * Copyright (C) 1998-2013 the VideoLAN team
  * $Id$
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
@@ -201,20 +201,14 @@ int main( int i_argc, const char *ppsz_argv[] )
     pthread_t self = pthread_self ();
     pthread_sigmask (SIG_SETMASK, &set, NULL);
 
-    const char *argv[i_argc + 2];
+    const char *argv[i_argc + 3];
     int argc = 0;
 
     argv[argc++] = "--no-ignore-config";
     argv[argc++] = "--media-library";
+    argv[argc++] = "--stats";
     ppsz_argv++; i_argc--; /* skip executable path */
-#ifdef __APPLE__
-    /* When VLC.app is run by double clicking in Mac OS X, the 2nd arg
-     * is the PSN - process serial number (a unique PID-ish thingie)
-     * still ok for real Darwin & when run from command line
-     * for example -psn_0_9306113 */
-    if (i_argc >= 1 && !strncmp (*ppsz_argv, "-psn" , 4))
-        ppsz_argv++, i_argc--;
-#endif
+
 #ifdef __OS2__
     for (int i = 0; i < i_argc; i++)
         if ((argv[argc++] = FromSystem (ppsz_argv[i])) == NULL)
@@ -234,17 +228,19 @@ int main( int i_argc, const char *ppsz_argv[] )
     /* Initialize libvlc */
     libvlc_instance_t *vlc = libvlc_new (argc, argv);
     if (vlc == NULL)
-        goto out;
+        return 1;
 
+    int ret = 1;
     libvlc_set_exit_handler (vlc, vlc_kill, &self);
+    libvlc_set_app_id (vlc, "org.VideoLAN.VLC", PACKAGE_VERSION, PACKAGE_NAME);
     libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
 
-#if !defined (HAVE_MAEMO) && !defined __APPLE__ && !defined (__OS2__)
+    libvlc_add_intf (vlc, "hotkeys,none");
+#if !defined (__OS2__)
     libvlc_add_intf (vlc, "globalhotkeys,none");
 #endif
 #ifdef HAVE_DBUS
     libvlc_add_intf (vlc, "dbus,none");
-    libvlc_add_intf (vlc, "inhibit,none");
 #endif
     if (libvlc_add_intf (vlc, NULL))
         goto out;
@@ -274,15 +270,13 @@ int main( int i_argc, const char *ppsz_argv[] )
     pthread_sigmask (SIG_UNBLOCK, &set, NULL);
     alarm (3);
 
+    ret = 0;
     /* Cleanup */
 out:
-    if (vlc != NULL)
-        libvlc_release (vlc);
-
+    libvlc_release (vlc);
 #ifdef __OS2__
-    for (int i = 2; i < argc; i++)
+    for (int i = argc - i_argc; i < argc; i++)
         free (argv[i]);
 #endif
-
-    return 0;
+    return ret;
 }