[MPlayer-dev-eng] [PATCH] '-priority' support on OS/2
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Feb 4 18:46:48 CET 2009
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.
More information about the MPlayer-dev-eng
mailing list