[vlc-devel] [PATCH] Remove libvlc equalizer implementation from the audio output core.
Mark Lee
mark.lee at capricasoftware.co.uk
Thu Sep 20 21:07:54 CEST 2012
Hello.
On 20 September 2012 19:06, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le mardi 18 septembre 2012 20:11:34, Mark Lee a écrit :
> > Rather than using callbacks in the core, the audio equalizer is simply
> > directly applied (when enabled) to the aout:
> >
> > 1. each time an aout is created;
> > 2. each time the equalizer is set on the media player.
> >
> > This is similar, in part, to how libvlc_set_fullscreen is implemented.
> > ---
> > lib/media_player.c | 31 +++++++++++++++++++++++++++----
> > src/audio_output/common.c | 15 ---------------
> > 2 files changed, 27 insertions(+), 19 deletions(-)
> >
> > diff --git a/lib/media_player.c b/lib/media_player.c
> > index b9b2a11..b468f96 100644
> > --- a/lib/media_player.c
> > +++ b/lib/media_player.c
> > @@ -32,6 +32,7 @@
> >
> > #include <vlc_demux.h>
> > #include <vlc_input.h>
> > +#include <vlc_aout.h>
> > #include <vlc_vout.h>
> > #include <vlc_keys.h>
> > #include <vlc_aout_intf.h>
> > @@ -191,6 +192,21 @@ static void set_state( libvlc_media_player_t *p_mi,
> > libvlc_state_t state, }
> > }
> >
> > +static void apply_equalizer( input_thread_t *p_input,
> > libvlc_media_player_t *p_mi ) +{
> > + audio_output_t *p_aout;
> > + if( input_Control( p_input, INPUT_GET_AOUT, &p_aout ) ==
> VLC_SUCCESS )
> > + {
> > + var_SetString( p_aout, "equalizer-bands", var_GetString( p_mi,
> > "equalizer-bands" ) ); + var_SetFloat( p_aout, "equalizer-preamp",
> > var_GetFloat( p_mi, "equalizer-preamp" ) ); +
> > + if( strlen( var_GetString( p_mi, "equalizer-bands" ) ) > 0 )
> > + aout_EnableFilter( p_mi, "equalizer", true );
>
> Memory leak and potential NULL dereference.
OK.
> Also in the old code that should not have been merged.
>
That ship has sailed. I'm doing what I can to resolve it.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120920/058d53cd/attachment.html>
More information about the vlc-devel
mailing list