Commit 8e7f4470 authored by Laurent Aimar's avatar Laurent Aimar

Added a callback on equalizer-2pass in equalizer filter.

It will allow to avoid reseting the whole aout for it.
parent 74d08390
...@@ -135,6 +135,8 @@ static int PreampCallback( vlc_object_t *, char const *, ...@@ -135,6 +135,8 @@ static int PreampCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
static int BandsCallback ( vlc_object_t *, char const *, static int BandsCallback ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
static int TwoPassCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
...@@ -405,6 +407,7 @@ static int EqzInit( aout_filter_t *p_filter, int i_rate ) ...@@ -405,6 +407,7 @@ static int EqzInit( aout_filter_t *p_filter, int i_rate )
var_AddCallback( p_aout, "equalizer-preset", PresetCallback, p_sys ); var_AddCallback( p_aout, "equalizer-preset", PresetCallback, p_sys );
var_AddCallback( p_aout, "equalizer-bands", BandsCallback, p_sys ); var_AddCallback( p_aout, "equalizer-bands", BandsCallback, p_sys );
var_AddCallback( p_aout, "equalizer-preamp", PreampCallback, p_sys ); var_AddCallback( p_aout, "equalizer-preamp", PreampCallback, p_sys );
var_AddCallback( p_aout, "equalizer-2pass", TwoPassCallback, p_sys );
msg_Dbg( p_filter, "equalizer loaded for %d Hz with %d bands %d pass", msg_Dbg( p_filter, "equalizer loaded for %d Hz with %d bands %d pass",
i_rate, p_sys->i_band, p_sys->b_2eqz ? 2 : 1 ); i_rate, p_sys->i_band, p_sys->b_2eqz ? 2 : 1 );
...@@ -488,6 +491,8 @@ static void EqzClean( aout_filter_t *p_filter ) ...@@ -488,6 +491,8 @@ static void EqzClean( aout_filter_t *p_filter )
"equalizer-preset", PresetCallback, p_sys ); "equalizer-preset", PresetCallback, p_sys );
var_DelCallback( (aout_instance_t *)p_filter->p_parent, var_DelCallback( (aout_instance_t *)p_filter->p_parent,
"equalizer-preamp", PreampCallback, p_sys ); "equalizer-preamp", PreampCallback, p_sys );
var_DelCallback( (aout_instance_t *)p_filter->p_parent,
"equalizer-2pass", TwoPassCallback, p_sys );
free( p_sys->f_alpha ); free( p_sys->f_alpha );
free( p_sys->f_beta ); free( p_sys->f_beta );
...@@ -603,4 +608,13 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -603,4 +608,13 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd,
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int TwoPassCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
aout_filter_sys_t *p_sys = (aout_filter_sys_t *)p_data;
/* FIXME lock (same for all other callbacks) */
p_sys->b_2eqz = newval.b_bool;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment