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

aout: move input restart on filter change from playlist code

So that it works for LibVLC too.
parent 0e63a3fc
...@@ -153,6 +153,14 @@ static int aout_GainNotify (audio_output_t *aout, float gain) ...@@ -153,6 +153,14 @@ static int aout_GainNotify (audio_output_t *aout, float gain)
return 0; return 0;
} }
static int FilterCallback (vlc_object_t *obj, const char *var,
vlc_value_t prev, vlc_value_t cur, void *data)
{
aout_InputRequestRestart ((audio_output_t *)obj);
(void) var; (void) prev; (void) cur; (void) data;
return VLC_SUCCESS;
}
#undef aout_New #undef aout_New
/** /**
* Creates an audio output object and initializes an output module. * Creates an audio output object and initializes an output module.
...@@ -267,6 +275,7 @@ audio_output_t *aout_New (vlc_object_t *parent) ...@@ -267,6 +275,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
} }
var_Create (aout, "audio-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT); var_Create (aout, "audio-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
var_AddCallback (aout, "audio-filter", FilterCallback, NULL);
text.psz_string = _("Audio filters"); text.psz_string = _("Audio filters");
var_Change (aout, "audio-filter", VLC_VAR_SETTEXT, &text, NULL); var_Change (aout, "audio-filter", VLC_VAR_SETTEXT, &text, NULL);
...@@ -313,6 +322,7 @@ void aout_Destroy (audio_output_t *aout) ...@@ -313,6 +322,7 @@ void aout_Destroy (audio_output_t *aout)
aout->device_select = NULL; aout->device_select = NULL;
aout_OutputUnlock (aout); aout_OutputUnlock (aout);
var_DelCallback (aout, "audio-filter", FilterCallback, NULL);
var_DelCallback (aout, "mute", var_Copy, aout->p_parent); var_DelCallback (aout, "mute", var_Copy, aout->p_parent);
var_SetFloat (aout, "volume", -1.f); var_SetFloat (aout, "volume", -1.f);
var_DelCallback (aout, "volume", var_Copy, aout->p_parent); var_DelCallback (aout, "volume", var_Copy, aout->p_parent);
......
...@@ -133,12 +133,8 @@ void playlist_EnableAudioFilter (playlist_t *pl, const char *name, bool add) ...@@ -133,12 +133,8 @@ void playlist_EnableAudioFilter (playlist_t *pl, const char *name, bool add)
{ {
audio_output_t *aout = playlist_GetAout (pl); audio_output_t *aout = playlist_GetAout (pl);
if (aout_ChangeFilterString (VLC_OBJECT(pl), VLC_OBJECT(aout), aout_ChangeFilterString (VLC_OBJECT(pl), VLC_OBJECT(aout),
"audio-filter", name, add)) "audio-filter", name, add);
{
if (aout != NULL)
aout_InputRequestRestart (aout);
}
if (aout != NULL) if (aout != NULL)
vlc_object_release (aout); vlc_object_release (aout);
} }
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