From 09bd19e59ee1b4cf9b8db16403a0c3f404af833a Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Dec 2013 23:04:40 +0100 Subject: af: remove legacy option parsing hacks --- audio/filter/af.c | 11 ++--------- audio/filter/af.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/audio/filter/af.c b/audio/filter/af.c index a48780885b..bb29603d5d 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -116,7 +116,6 @@ const struct m_obj_list af_obj_list = { {"force", "format"}, {0} }, - .legacy_hacks = true, // many filters have custom option parsing }; static bool af_config_equals(struct mp_audio *a, struct mp_audio *b) @@ -206,19 +205,13 @@ static struct af_instance *af_create(struct af_stream *s, char *name, struct m_config *config = m_config_from_obj_desc(af, &desc); if (m_config_apply_defaults(config, name, s->opts->af_defs) < 0) goto error; - if (m_config_initialize_obj(config, &desc, &af->priv, &args) < 0) + if (m_config_set_obj_params(config, args) < 0) goto error; + af->priv = config->optstruct; // Initialize the new filter if (af->info->open(af) != AF_OK) goto error; - if (args && af->control) { - // Single option string for old filters - char *opts = (char *)args; // m_config_initialize_obj did this - assert(!af->priv); - if (af->control(af, AF_CONTROL_COMMAND_LINE, opts) <= AF_ERROR) - goto error; - } return af; diff --git a/audio/filter/af.h b/audio/filter/af.h index 77f3bb4945..4e74ffbe4c 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -99,7 +99,6 @@ struct af_stream { enum af_control { AF_CONTROL_REINIT = 1, AF_CONTROL_RESET, - AF_CONTROL_COMMAND_LINE, AF_CONTROL_SET_RESAMPLE_RATE, AF_CONTROL_SET_FORMAT, AF_CONTROL_SET_CHANNELS, -- cgit v1.2.3