[MPlayer-cygwin] [PATCH] automatic high-priority

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 24 14:56:07 CEST 2004


Hi,
this is a patch that gives mplayer automatically "high" priority on
windows. Can be disabled with the -nopriority option. The high priority
still allows to change to a different task if mplayer hangs, although
you'll have to wait _very_ long :-(.
Worked for me on WinXP and Win98SE.
Please test.

Greetings,
Reimar Döffinger
-------------- next part --------------
--- cfg-mplayer.h	2004-09-15 21:36:28.000000000 +0200
+++ cfg-mplayer.h	2004-10-22 10:57:15.829252355 +0200
@@ -418,5 +422,9 @@
 	{"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
 	{"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
 	{"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
+#ifdef WIN32
+	{"priority", &high_priority, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
+	{"nopriority", &high_priority, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
+#endif
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
--- mplayer.c	2004-10-20 22:20:09.000000000 +0200
+++ mplayer.c	2004-10-22 10:58:03.131284681 +0200
@@ -219,6 +219,10 @@
 int osd_level_saved=-1;
 int osd_visible=100;
 
+#ifdef WIN32
+int high_priority=1;
+#endif
+
 // seek:
 static char *seek_to_sec=NULL;
 static off_t seek_to_byte=0;
@@ -1148,6 +1180,11 @@
   if ( !use_gui ) load_termcap(NULL); // load key-codes
 #endif
 
+#ifdef WIN32
+if (high_priority)
+  SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
+#endif
+
 // ========== Init keyboard FIFO (connection to libvo) ============
 
 // Init input system


More information about the MPlayer-cygwin mailing list