[MPlayer-dev-eng] [PATCH] af_pan.c: Avoid zero output channels when reinit af pan

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Jun 7 11:56:15 CEST 2007


Hello,
On Thu, Jun 07, 2007 at 09:50:08AM +0800, Zuxy Meng wrote:
> 2007/6/5, Zuxy Meng <zuxy.meng at gmail.com>:
> > 2007/6/5, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> > > On Tue, Jun 05, 2007 at 12:55:52PM +0200, Reimar Doeffinger wrote:
> > > > On Tue, Jun 05, 2007 at 05:32:53PM +0800, Zuxy Meng wrote:
> > > > [...]
> > > > > But instead we call af_add() for pan, the sequence will be
> > > > > AF_CONTROL_POST_CREATE->AF_CONTROL_REINIT->AF_CONTROL_PAN_NOUT. If we
> > > > > don't assign a non-zero value to af->data->nch, AF_CONTROL_REINT of af
> > > > > pan will always fail and we have no chance to add this filter at
> > > > > runtime, which is needed for (soft) audio balance control.
> > > >
> > > > Well, IMO if a filter needs more data to work, make sure it is created with
> > > > sufficient information instead of letting it dangle in an inconsistent
> > > > state.
> > > > E.g. use af_create with e.g. af_append or expand af_add to support a
> > > > commandline.
> > >
> > > If you don't want to do it like this, then please let use first see the
> > > code that needs it. I'd guess that would help both with finding a better
> > > solution and convincing be to be okay with this one.
> >
> > It's in another patch, namely the audio balance feature.
> 
> What's your suggestion, Reimar?

I don't think it's really the right solution, but a proper one might not
be worth the effort. Though you might consider if initializing the nch
to 1 during filter creation isn't the better (and simpler) solution.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list