[MPlayer-dev-eng] [PATCH] '-priority' support on OS/2

KO Myung-Hun komh at chollian.net
Thu Feb 5 14:39:00 CET 2009


Hi/2.

Reimar Döffinger wrote:
> Diego will have to comment on the configure stuff, but
>
>   
>> Index: osdep/priority-win.c
>> ===================================================================
>> --- osdep/priority-win.c    (revision 0)
>> +++ osdep/priority-win.c    (revision 0)
>> @@ -0,0 +1,67 @@
>>     
>
> That file is basically identical to the OS/2 one, you'd only need two
> sime #ifdefs....
>
> #ifdef __OS2__
>   
>> +#define INCL_DOS
>> +#include <os2.h>
>>     
> #define REALTIME_PRIORITY_CLASS     MAKESHORT(0, PRTYC_TIMECRITICAL)
> #define HIGH_PRIORITY_CLASS         MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
> #define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(15, PRTYC_REGULAR)
> #define NORMAL_PRIORITY_CLASS       MAKESHORT(0, PRTYC_REGULAR)
> #define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
> #define IDLE_PRIORITY_CLASS         MAKESHORT(0, PRTYC_IDLETIME)
> #define NORMAL_PRIORITY_CLASS       MAKESHORT(0, PRTYC_REGULAR)
> #else
>   
>> +#include <windows.h>
>>     
> #endif
>
> #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
>
> There is probably an even nicer way to avoid duplicating that code but I
> don't have a good idea right now.
>   

It's my first approach, but I thought you didn't like #ifdef. Anyway you 
suggested #ifdef , so I'll use it.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr





More information about the MPlayer-dev-eng mailing list