From 3b8dfddb4cb6e9431da659b10c5b31a9f17c81b5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Jul 2013 14:43:58 +0200 Subject: audio/filter: use new option API Make the VF/VO/AO option parser available to audio filters. No audio filter uses this yet, but it's still a quite intrusive change. In particular, the commands for manipulating filters at runtime completely change. We delete the old code, and use the same infrastructure as for video filters. (This forces complete reinitialization of the filter chain, which hopefully isn't a problem for any use cases. The old code forced reinitialization too, but it could potentially allow a filter to cache things; e.g. consider loaded ladspa plugins and such.) --- audio/mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio/mixer.c') diff --git a/audio/mixer.c b/audio/mixer.c index 0f1a7871d6..7ccfaa4639 100644 --- a/audio/mixer.c +++ b/audio/mixer.c @@ -113,7 +113,7 @@ static void setvolume_internal(mixer_t *mixer, float l, float r) { mp_tmsg(MSGT_GLOBAL, mixer->softvol ? MSGL_V : MSGL_WARN, "[Mixer] No hardware mixing, inserting volume filter.\n"); - if (!(af_add(mixer->afilter, "volume") + if (!(af_add(mixer->afilter, "volume", NULL) && af_control_any_rev(mixer->afilter, AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, db_vals))) @@ -220,7 +220,7 @@ void mixer_setbalance(mixer_t *mixer, float val) if (val == 0 || mixer->ao->channels.num < 2) return; - if (!(af_pan_balance = af_add(mixer->afilter, "pan"))) { + if (!(af_pan_balance = af_add(mixer->afilter, "pan", NULL))) { mp_tmsg(MSGT_GLOBAL, MSGL_ERR, "[Mixer] No balance control available.\n"); return; -- cgit v1.2.3