Index: DOCS/man/en/mplayer.1 =================================================================== --- DOCS/man/en/mplayer.1 (revision 26268) +++ DOCS/man/en/mplayer.1 (working copy) @@ -699,9 +699,9 @@ handle carriage return (i.e.\& \\r). . .TP -.B \-priority (Windows only) +.B \-priority (Windows and OS/2 only) Set process priority for MPlayer according to the predefined -priorities available under Windows. +priorities available under Windows and OS/2. Possible values of : .RSs idle|belownormal|normal|abovenormal|high|realtime Index: mplayer.c =================================================================== --- mplayer.c (revision 26268) +++ mplayer.c (working copy) @@ -6,6 +6,11 @@ #include #include "config.h" +#ifdef __OS2__ +#define INCL_DOS +#include +#endif + #ifdef WIN32 #define _UWIN 1 /*disable Non-underscored versions of non-ANSI functions as otherwise int eof would conflict with eof()*/ #include @@ -87,7 +92,7 @@ int quiet=0; int enable_mouse_movements=0; -#ifdef WIN32 +#if defined(WIN32) || defined(__OS2__) char * proc_priority=NULL; #endif @@ -2626,7 +2635,7 @@ } #endif -#ifdef WIN32 +#if defined(WIN32) || defined(__OS2__) if(proc_priority){ int i; for(i=0; priority_presets_defs[i].name; i++){ @@ -2635,7 +2644,14 @@ } mp_msg(MSGT_CPLAYER,MSGL_STATUS,"Setting process priority: %s\n", priority_presets_defs[i].name); + #ifdef __OS2__ + DosSetPriority(PRTYS_PROCESS, + HIBYTE(priority_presets_defs[i].prio), + LOBYTE(priority_presets_defs[i].prio), + 0 ); + #else SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio); + #endif } #endif #ifndef HAVE_NEW_GUI Index: cfg-common.h =================================================================== --- cfg-common.h (revision 26268) +++ cfg-common.h (working copy) @@ -13,7 +13,7 @@ {"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL}, -#ifdef WIN32 +#if defined(WIN32) || defined(__OS2__) {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif @@ -708,6 +708,22 @@ { "idle", IDLE_PRIORITY_CLASS}, { NULL, NORMAL_PRIORITY_CLASS} /* default */ }; +#elif defined(__OS2__) + +extern char * proc_priority; + +struct { + char* name; + int prio; +} priority_presets_defs[] = { + { "realtime", MAKESHORT(0, PRTYC_TIMECRITICAL)}, + { "high", MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)}, + { "abovenormal", MAKESHORT(15, PRTYC_REGULAR)}, + { "normal", MAKESHORT(0, PRTYC_REGULAR)}, + { "belownormal", MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)}, + { "idle", MAKESHORT(0, PRTYC_IDLETIME)}, + { NULL, MAKESHORT(0, PRTYC_REGULAR)} /* default */ +}; #endif /* WIN32 */ extern const m_option_t lavc_decode_opts_conf[]; Index: mencoder.c =================================================================== --- mencoder.c (revision 26268) +++ mencoder.c (working copy) @@ -25,6 +25,11 @@ #include #include "config.h" +#ifdef __OS2__ +#define INCL_DOS +#include +#endif + #ifdef __MINGW32__ #define SIGHUP 1 #define SIGQUIT 3 @@ -143,7 +148,7 @@ double cur_vout_time_usage=0; int benchmark=0; -#ifdef WIN32 +#if defined(WIN32) || defined(__OS2__) char * proc_priority=NULL; #endif @@ -509,7 +518,7 @@ } } -#ifdef WIN32 +#if defined(WIN32) || defined(__OS2__) if(proc_priority){ int i; for(i=0; priority_presets_defs[i].name; i++){ @@ -518,7 +527,14 @@ } mp_msg(MSGT_CPLAYER,MSGL_STATUS,MSGTR_SettingProcessPriority, priority_presets_defs[i].name); +#ifdef __OS2__ + DosSetPriority(PRTYS_PROCESS, + HIBYTE(priority_presets_defs[i].prio), + LOBYTE(priority_presets_defs[i].prio), + 0 ); +#else SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio); +#endif } #endif