[MPlayer-cvslog] CVS: main mplayer.c, 1.835, 1.836 mencoder.c, 1.276, 1.277 cfg-common.h, 1.141, 1.142

Sascha Sommer CVS syncmail at mplayerhq.hu
Sat Apr 2 20:29:18 CEST 2005


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv14688

Modified Files:
	mplayer.c mencoder.c cfg-common.h 
Log Message:
windows priority support patch by Rune Petersen <runner at mail.tele.dk> with the freedom to shoot yourself in the foot

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.835
retrieving revision 1.836
diff -u -r1.835 -r1.836
--- mplayer.c	25 Feb 2005 11:11:07 -0000	1.835
+++ mplayer.c	2 Apr 2005 18:29:14 -0000	1.836
@@ -88,6 +88,10 @@
 int identify=0;
 int quiet=0;
 
+#ifdef WIN32
+char * proc_priority=NULL;
+#endif
+
 #define ABS(x) (((x)>=0)?(x):(-(x)))
 #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
 
@@ -1145,6 +1149,18 @@
       }
     }
 	
+#ifdef WIN32
+	if(proc_priority){
+		int i;
+        	for(i=0; priority_presets_defs[i].name; i++){
+        		if(strcasecmp(priority_presets_defs[i].name, proc_priority) == 0)
+				break;
+		}
+		mp_msg(MSGT_CPLAYER,MSGL_STATUS,"Setting process priority: %s\n",
+				priority_presets_defs[i].name);
+		SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio);
+	}
+#endif	
 #ifndef HAVE_NEW_GUI
     if(use_gui){
       mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoGui);

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -r1.276 -r1.277
--- mencoder.c	23 Mar 2005 23:29:54 -0000	1.276
+++ mencoder.c	2 Apr 2005 18:29:15 -0000	1.277
@@ -153,6 +153,10 @@
 double cur_vout_time_usage=0;
 int benchmark=0;
 
+#ifdef WIN32
+char * proc_priority=NULL;
+#endif
+
 // A-V sync:
 int delay_corrected=1;
 static float default_max_pts_correction=-1;//0.01f;
@@ -479,6 +483,19 @@
 
   mp_msg_set_level(verbose+MSGL_STATUS);
 
+#ifdef WIN32
+  if(proc_priority){
+    int i;
+    for(i=0; priority_presets_defs[i].name; i++){
+      if(strcasecmp(priority_presets_defs[i].name, proc_priority) == 0)
+        break;
+    }
+    mp_msg(MSGT_CPLAYER,MSGL_STATUS,"Setting process priority: %s\n",
+					priority_presets_defs[i].name);
+    SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio);
+  }
+#endif	
+
 // check font
 #ifdef USE_OSD
 #ifdef HAVE_FREETYPE

Index: cfg-common.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-common.h,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -r1.141 -r1.142
--- cfg-common.h	19 Mar 2005 20:55:51 -0000	1.141
+++ cfg-common.h	2 Apr 2005 18:29:15 -0000	1.142
@@ -6,6 +6,7 @@
 	{"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 100, NULL},
 	{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL},
 	{"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL},
+	{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
 
 // ------------------------- stream options --------------------
 
@@ -470,6 +471,24 @@
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 
+#ifdef WIN32
+
+extern char * proc_priority;
+
+struct {
+  char* name;
+  int prio;
+} priority_presets_defs[] = {
+  { "realtime", REALTIME_PRIORITY_CLASS},
+  { "high", HIGH_PRIORITY_CLASS},
+  { "abovenormal", ABOVE_NORMAL_PRIORITY_CLASS},
+  { "normal", NORMAL_PRIORITY_CLASS},
+  { "belownormal", BELOW_NORMAL_PRIORITY_CLASS},
+  { "idle", IDLE_PRIORITY_CLASS},
+  { NULL, NORMAL_PRIORITY_CLASS} /* default */
+};
+#endif /* WIN32 */
+
 #ifdef USE_LIBAVCODEC
 extern m_option_t lavc_decode_opts_conf[];
 #endif




More information about the MPlayer-cvslog mailing list