[MPlayer-dev-eng] [PATCH] libbs2b audio filter

Uoti Urpala uoti.urpala at pp1.inet.fi
Sun Mar 29 00:51:01 CET 2009


On Sun, 2009-03-29 at 01:09 +0300, Andrew Savchenko wrote:
> Hi,
> 
> On Saturday 28 March 2009 16:14, Uoti Urpala wrote:
> [...]
> > > > Add a special return value to the API that at best avoids a
> > > > single line of additional code when it's used? I think
> > > > that's clearly a bad tradeoff. If the filter wants uninit()
> > > > called then it can call that itself before returning.
> > >
> > > You definitely misread my message. Where you can see single
> > > additional line? Without function call described above whole
> > > uninit function will be actually duplicated after the goto's
> > > label.
> >
> > As far as I can tell I did not misread your message, but you did
> > not understand what I said. What I meant was that at best your
> > "special error code" suggestion turns "uninit(); return ERROR;"
> > into "return MAGIC_ERROR_CODE;".
> 
> Nope, my idea differs, maybe my original explanation was unclear.
> I do not propose to call uninit in each filter before return.
> I propose to modify filter initializer in af.c, thus this will be 
> single modification affects all filters at once, e.g.:

This still sounds exactly like how I interpreted it the first time.
Yes you do not propose to call uninit() before return; the point was
that compared to calling it your idea would only save that single call
even in the best case.

> err=new->info->open(new);
> if (err == AF_FATAL)
> 	new->info->uninit(new);
> else {
> 	//...
> }

And as I wrote above, this would at most help avoid a single uninit()
call per AF_FATAL use. If by your above "affects all filters at once"
you mean that the change to af.c would immediately help all filters
without working on them individually then I disagree. Currently nothing
uses AF_FATAL, and suddenly starting to call uninit() after other errors
without checking the filters individually would not be safe.




More information about the MPlayer-dev-eng mailing list