[MPlayer-cygwin] Change priority to realtime in windows

Sascha Sommer saschasommer at freenet.de
Wed Oct 6 12:30:26 CEST 2004


On Tuesday 05 October 2004 16:20, Joey Parrish wrote:
> On Tue, Oct 05, 2004 at 01:02:54PM +0200, Diego Biurrun wrote:
> > Joseph Miller writes:
> > > On Sunday 26 September 2004 6:28 pm, Daniel Johansson wrote:
> > > > Hi, how to I change so that mplayer gets realtime priority by windows
> > > > every time I start a movie? I got some problems with laggy movies but
> > > > it works fine as soon as I change the priority to realtime. Is there
> > > > any way to tell mplayer to always use realtime as priority, if so
> > > > how?
> > >
> > > SetThreadPriority in winbase.h ought to help you out some.
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllpro
> > >c/base/setthreadpriority.asp
> >
> > Any volunteers to implement something like this as an option?  It has
> > been requested many many times..
>
> #ifdef WIN32
> # include <windows.h>
> #endif
>   [...]
> #ifdef WIN32
>   SetThreadPriority(GetCurrentProcess(), THREAD_PRIORITY_TIME_CRITICAL);
> #endif
>
> IMHO, "time critical" is helpful, but not so aggressive that it even
> needs to be optional.  I do this in my packages.  With this priority,
> MPlayer gets preference over other normal apps, but will still defer CPU
> time to critical OS tasks.

Not sure. I tryed to change the priority once on win98. And when playback 
finished MPlayer kept eating 100% cpu until the audio device was closed (up 
to 2secs). Not even explorer reacted in ths time. Whoever is making the 
patch, please test it on different windows versions.


> However, I think "real time" priority is bad, because it means as soon
> as I try to play an extremely high bitrate file that my CPU just can't
> handle, MPlayer eats up 100% CPU and gets priority over a lot of basic
> windows components.  I think this is a bad idea always.
>

Agree.

Sascha




More information about the MPlayer-cygwin mailing list