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

Ulion ulion2002 at gmail.com
Wed Jan 30 12:57:01 CET 2008


2008/1/30, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Mon, Jan 28, 2008 at 08:51:36PM +0800, Ulion wrote:
> > patch 2: support run command with specific osd level, need apply patch 1 first.
>
> That one IMO is overcomplicated, I think you do more checking than makes
> sense.
> I think it should be something like (note, this just illustrates the
> idea, it probably is buggy):
> if (strncmp(...)) {
>   str += 10;
>   osd = strtol(str, &str, 0);
>   if (*str != ' ')
>     return NULL;
>   str++;
> }
>
> The reason for this is just that it is pointless to check for all these
> cases of incorrect syntax when you do not handle the error case
> correctly anyway! Even more so if like this you limit the osd level to 9
> without a good reason.

osd level is indeed max 3 in mplayer, I just limit the osd_level
prefix to fit the real osd level mplayer can accept, if some day the
osd level can greater than 9, I will have to rewrite this code, but
now we are not necessary support any osd_level prefix with an level
not accepted by mplayer. I just write the code accurately only works
for valid osd_level prefixes. Others' opinions?

-- 
Ulion



More information about the MPlayer-dev-eng mailing list