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

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Mar 28 14:14:55 CET 2009


On Sat, 2009-03-28 at 08:09 +0300, Andrew Savchenko wrote:
> On Saturday 28 March 2009 06:49, Uoti Urpala wrote:
> > On Sat, 2009-03-28 at 06:21 +0300, Andrew Savchenko wrote:
> > > I admit, in rare cases goto is a good solution, but not it
> > > this one. Please note: cleanups with all sanity checks are
> > > already implemented as uninit functions. So IMO the best
> > > solution in particular case of libaf will be to call uninit
> > > function if an appropriate error code from af_open is
> > > returned. Perhaps the best choise for return code will be
> > > AF_FATAL due to severe nature of memory allocation problems.
> > > However, special code of mask like AF_CLEANUP may be
> > > introduced.
> >
> > 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;".




More information about the MPlayer-dev-eng mailing list