Commit edada22b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: inline one function and simplify

parent e911cf1f
...@@ -250,12 +250,6 @@ error: ...@@ -250,12 +250,6 @@ error:
#define aout_FiltersPipelineCreate(obj,f,n,m,i,o) \ #define aout_FiltersPipelineCreate(obj,f,n,m,i,o) \
aout_FiltersPipelineCreate(VLC_OBJECT(obj),f,n,m,i,o) aout_FiltersPipelineCreate(VLC_OBJECT(obj),f,n,m,i,o)
static inline bool ChangeFiltersString (vlc_object_t *aout, const char *var,
const char *filter, bool add)
{
return aout_ChangeFilterString (aout, aout, var, filter, add);
}
/** /**
* Filters an audio buffer through a chain of filters. * Filters an audio buffer through a chain of filters.
*/ */
...@@ -300,26 +294,21 @@ static int VisualizationCallback (vlc_object_t *obj, const char *var, ...@@ -300,26 +294,21 @@ static int VisualizationCallback (vlc_object_t *obj, const char *var,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static int EqualizerCallback (vlc_object_t *obj, char const *var, static int EqualizerCallback (vlc_object_t *obj, const char *var,
vlc_value_t oldval, vlc_value_t newval, vlc_value_t oldval, vlc_value_t newval,
void *data) void *data)
{ {
audio_output_t *aout = (audio_output_t *)obj; const char *val = newval.psz_string;
char *mode = newval.psz_string;
bool ret;
if (!*mode) if (*val)
ret = ChangeFiltersString (obj, "audio-filter", "equalizer", false);
else
{ {
var_Create (obj, "equalizer-preset", VLC_VAR_STRING); var_Create (obj, "equalizer-preset", VLC_VAR_STRING);
var_SetString (obj, "equalizer-preset", mode); var_SetString (obj, "equalizer-preset", val);
ret = ChangeFiltersString (obj, "audio-filter", "equalizer", true);
} }
/* That sucks */ if (aout_ChangeFilterString (obj, obj, "audio-filter", "equalizer", *val))
if (ret) aout_InputRequestRestart ((audio_output_t *)obj); /* <- That sucks! */
aout_InputRequestRestart (aout);
(void) var; (void) oldval; (void) data; (void) var; (void) oldval; (void) data;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
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