diff mencoder.c @ 15042:265d8b8adbbe

windows priority support patch by Rune Petersen <runner at mail.tele.dk> with the freedom to shoot yourself in the foot
author faust3
date Sat, 02 Apr 2005 18:29:16 +0000
parents 576b810a034d
children cec31d399b8a
line wrap: on
line diff
--- a/mencoder.c	Sat Apr 02 16:38:14 2005 +0000
+++ b/mencoder.c	Sat Apr 02 18:29:16 2005 +0000
@@ -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