- /* We'll have to split the conversion. We always do the downmixing
- * before the resampling, because the audio decoder can probably do it
- * for us. */
- i_nb_conversions = SplitConversion( p_input_format,
- p_output_format, &temp_format );
- if ( !i_nb_conversions )
+ var_SetString (obj, "audio-visual", mode);
+ aout_InputRequestRestart ((audio_output_t *)obj);
+ (void) var; (void) oldval; (void) data;
+ return VLC_SUCCESS;
+}
+
+vout_thread_t *aout_filter_RequestVout (filter_t *filter, vout_thread_t *vout,
+ video_format_t *fmt)
+{
+ /* NOTE: This only works from aout_filters_t.
+ * If you want to use visualization filters from another place, you will
+ * need to add a new pf_aout_request_vout callback or store a pointer
+ * to aout_request_vout_t inside filter_t (i.e. a level of indirection). */
+ const aout_request_vout_t *req = filter->owner.sys;
+ char *visual = var_InheritString (filter->p_parent, "audio-visual");
+ /* NOTE: Disable recycling to always close the filter vout because OpenGL
+ * visualizations do not use this function to ask for a context. */
+ bool recycle = false;
+ free (visual);
+
+ return req->pf_request_vout (req->p_private, vout, fmt, recycle);
+}
+
+static int AppendFilter(vlc_object_t *obj, const char *type, const char *name,
+ aout_filters_t *restrict filters, const void *owner,
+ audio_sample_format_t *restrict infmt,
+ const audio_sample_format_t *restrict outfmt)
+{
+ const unsigned max = sizeof (filters->tab) / sizeof (filters->tab[0]);
+ if (filters->count >= max)