[vlc-devel] [PATCH 1/2] libvlc: add equalizer API

Mark Lee mark.lee at capricasoftware.co.uk
Sun Jul 14 09:06:06 CEST 2013


Hello...

On 13 July 2013 20:39, Rémi Denis-Courmont <remi at remlab.net> wrote:

> On Wednesday 10 July 2013 20:44:54 Mark Lee wrote:
> > > > diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
> > > > index 41b23b4..ea451a3 100644
> > > > --- a/src/audio_output/filters.c
> > > > +++ b/src/audio_output/filters.c
> > > > @@ -314,8 +314,7 @@ static int EqualizerCallback (vlc_object_t *obj,
> > >
> > > const
> > >
> > > > char *var, void *data)
> > > >
> > > >  {
> > > >
> > > >      const char *val = newval.psz_string;
> > > >
> > > > -
> > > > -    if (*val)
> > > > +    if (!strcmp("equalizer", var) && *val)
> > >
> > > Tautology.
> >
> > Sorry, I don't understand this.
>
> If var compares equal to "equalizer", then *var equals 'e' and is thus
> necessarily true.
>

But "var" and "val" are different things. I never reference "*var".

"var" is the name of the vlc variable that triggered the callback.

"val" is it's new value.

When var compares equal to "equalizer", then *val is either \0 or the
(first byte of the) name of a preset.

When var compares equal to "equalizer-bands", then *val is either \0 or
the (first byte of the) concatenation of equalizer band frequency
values.

Not directly on point, just for context: that "equalizer" variable is
existing functionality, and is not related to this patch - but rather than
duplicate a callback for the new patch, I re-used the existing callback
(conditionally).

 --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>


<http://apricasoftware.co.uk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130714/7ea59b61/attachment.html>


More information about the vlc-devel mailing list