diff -Naur a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 2005-03-21 02:12:44.000000000 +0100 +++ b/DOCS/man/en/mplayer.1 2005-03-30 14:02:49.890625000 +0200 @@ -544,6 +544,15 @@ For B-frames even decoding is skipped completely. . .TP +.B \-priority (Windows only) +Set process priority for MPlayer according to Windows predefined priorities. +.sp 1 +Possible values of : +.RSs +idle|low|belownormal|normal|abovenormal|high|realtime +.RE +. +.TP .B \-h, \-help, \-\-help Show short summary of options. . diff -Naur a/cfg-mplayer.h b/cfg-mplayer.h --- a/cfg-mplayer.h 2005-03-19 21:55:52.000000000 +0100 +++ b/cfg-mplayer.h 2005-03-30 14:09:09.593750000 +0200 @@ -105,6 +105,10 @@ extern int nortc; #endif +#ifdef WIN32 +extern char * proc_priority; +#endif + /* from libvo/aspect.c */ extern float monitor_aspect; @@ -247,6 +251,9 @@ {"adapter", &vo_adapter_num, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL}, {"refreshrate",&vo_refresh_rate,CONF_TYPE_INT,CONF_RANGE, 0,100, NULL}, +#ifdef WIN32 + {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#endif {"wid", &WinID, CONF_TYPE_INT, 0, 0, 0, NULL}, #ifdef HAVE_X11 // x11,xv,xmga,xvidix diff -Naur a/mplayer.c b/mplayer.c --- a/mplayer.c 2005-02-25 12:11:08.000000000 +0100 +++ b/mplayer.c 2005-03-30 14:09:09.593750000 +0200 @@ -997,6 +997,24 @@ } #endif +#ifdef WIN32 +char * proc_priority; + +struct priority_preset_t { + 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}, + { "low", IDLE_PRIORITY_CLASS}, + { "idle", IDLE_PRIORITY_CLASS}, + { NULL, NORMAL_PRIORITY_CLASS} /* default */ +}; +#endif /* WIN32 */ + int main(int argc,char* argv[]){ @@ -1145,6 +1163,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);