[MPlayer-dev-eng] [PATCH] support run command with specific osd_level

Ulion ulion2002 at gmail.com
Sat Feb 2 03:09:03 CET 2008


2008/2/1, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Fri, Feb 01, 2008 at 08:51:41AM +0800, Ulion wrote:
> > An osd msg currently will be put into osd stack, and if it match the
> > osd_level when update_osd_msgs get called, it will be choose and
> > displayed. Normally an osd msg will keep in the osd stack for 5
> > seconds.
> > Check these lines of my patch:
> >
> > +    // Force to disable osd msgs.
> > +    if (mpctx->force_osd_level == 0)
> > +        return;
> > +    // Force to display osd msgs matching the force_osd_level.
> > +    if (mpctx->force_osd_level > 0 && level <= mpctx->force_osd_level)
> > +        level = 0;
> >
> > This is expected behavior, but your patch missed it.
>
> Actually, I now think that the approach is fundamentally flawed.
> Why not making the specified osd_level the level of the OSD components
> related to the command instead of changing the global OSD level.
> At least the above code would the just become
> > if (mpctx->cmd_osd_level)
> >   level = mpctx->cmd_osd_level;
>
> I remains to be seen if the other parts fit well into this model as
> well.

this chunk of code won't give what you or we want.
when cmd_osd_level == 0, should be no osd msgs inserted or even if
inserted it should be never get displayed, but change the level to 0
will make it always get displayed.
level can not be assigned from cmd_osd_level.
and like this way, we will lost the meaning of original osd msg's
level, even if they are probably value 1.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list