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

Diego Biurrun diego at biurrun.de
Mon Aug 11 00:00:02 CEST 2008


On Sat, Aug 09, 2008 at 04:30:20AM +0900, KO Myung-Hun wrote:
> 
> This patch enable a '-priority' option support on OS/2.
> 
> --- mplayer.c   (revision 27376)
> +++ mplayer.c   (working copy)
> @@ -6,6 +6,11 @@
>  
> +#ifdef __OS2__
> +#define INCL_DOS
> +#include <os2.h>
> +#endif
> +
> @@ -2642,7 +2653,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

Maybe you can move the #include below this #ifdef.

> --- mencoder.c  (revision 27376)
> +++ mencoder.c  (working copy)
> @@ -525,7 +534,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);

All of this is duplicated in mplayer.c and mencoder.c.  Refactoring it is
not necessarily your job, but I'm nonetheless unhappy about this.  

> --- cfg-common.h    (revision 27376)
> +++ cfg-common.h    (working copy)
> @@ -373,6 +373,22 @@
> +#elif defined(__OS2__)
> +
> +extern char * proc_priority;

This line is duplicated.  I will look into refactoring this so it
becomes unneeded.

Diego



More information about the MPlayer-dev-eng mailing list