]> git.sesse.net Git - vlc/blobdiff - src/misc/win32_specific.c
* ALL: using "%ll" in printf format strings is not portable (notably on win32) so
[vlc] / src / misc / win32_specific.c
index 98d88d3856715cee8ad3823796264d4049e45976..643f177de81b14f08d36de71ccf24c0e8339a700 100644 (file)
@@ -2,7 +2,7 @@
  * win32_specific.c: Win32 specific features 
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: win32_specific.c,v 1.16 2002/10/04 12:01:40 gbazin Exp $
+ * $Id: win32_specific.c,v 1.18 2002/11/08 10:26:53 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -57,6 +57,22 @@ void system_Configure( vlc_t *p_this )
 {
     p_this->p_libvlc->b_fast_mutex = config_GetInt( p_this, "fast-mutex" );
     p_this->p_libvlc->i_win9x_cv = config_GetInt( p_this, "win9x-cv-method" );
+
+    /* Raise default priority of the current process */
+#ifndef ABOVE_NORMAL_PRIORITY_CLASS
+#   define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
+#endif
+    if( !SetPriorityClass( GetCurrentProcess(),
+                          ABOVE_NORMAL_PRIORITY_CLASS ) )
+    {
+        if( !SetPriorityClass( GetCurrentProcess(),
+                              HIGH_PRIORITY_CLASS ) )
+           msg_Dbg( p_this, "can't raise process priority" );
+       else
+           msg_Dbg( p_this, "raised process priority" );
+    }
+    else
+       msg_Dbg( p_this, "raised process priority" );
 }
 
 /*****************************************************************************