[MPlayer-dev-eng] expand_property wrong code or wrong document?

Alban Bedel albeu at free.fr
Mon Dec 17 14:05:00 CET 2007


On Mon, 17 Dec 2007 10:28:09 +0800
Ulion <ulion2002 at gmail.com> wrote:

> Hello,
> 
> $(NAME:TEXT) in document while ?(NAME:TEXT) in code
> Which one should it be?

Obviously the documentation is wrong, my bad.

> Also by the code a property should return unavaiable for a get request
> if it is unavaiable even when arg is NULL, then I have to at least fix
> chapter property for this...

Yes, that's how a property can be tested for readability. The logic is
that UNAVAILABLE is a global status independent of the requested
action, so it should be tested before processing ANY action.

Note that this apply to writing too, passing a NULL argument can be
used to test writability. So similarily the property should check if
it's writable (and return DISABLED if not) before checking if the
argument is there.

When I wrote this, I thought that would work because ppl would just
copy/paste the code like they do everywhere. But it seems the code
look too simple and most ppl then insist on "optimizing" it, breaking
half the API in the process :(

	Albeu




More information about the MPlayer-dev-eng mailing list