diff --git a/DOCS/tech/slave.txt b/DOCS/tech/slave.txt index 73deb5e3a2..330534cefe 100644 --- a/DOCS/tech/slave.txt +++ b/DOCS/tech/slave.txt @@ -53,6 +53,9 @@ af_add (comma separated list of audio filters with para af_clr (experimental) Unload all loaded audio filters. +af_cmdline + (experimental) Send new command-line options to a filter with the given name. + af_del (comma separated list of audio filter's names) (experimental) Unload the first occurrence of the filters, if loaded. diff --git a/command.c b/command.c index bcfe206f07..60d04d4248 100644 --- a/command.c +++ b/command.c @@ -3496,6 +3496,19 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) af_init(mpctx->mixer.afilter); build_afilter_chain(mpctx, sh_audio, &ao_data); break; + case MP_CMD_AF_CMDLINE: + if (sh_audio) { + af_instance_t *af = af_get(sh_audio->afilter, cmd->args[0].v.s); + if (!af) { + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Filter '%s' not found in chain.\n", cmd->args[0].v.s); + break; + } + af->control(af, AF_CONTROL_COMMAND_LINE, cmd->args[1].v.s); + af_reinit(sh_audio->afilter, af); + } + break; + default: mp_msg(MSGT_CPLAYER, MSGL_V, "Received unknown cmd %s\n", cmd->name); diff --git a/input/input.c b/input/input.c index c366ca76e4..1e2a6e888e 100644 --- a/input/input.c +++ b/input/input.c @@ -215,6 +215,7 @@ static const mp_cmd_t mp_cmds[] = { { MP_CMD_AF_ADD, "af_add", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, { MP_CMD_AF_DEL, "af_del", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, { MP_CMD_AF_CLR, "af_clr", 0, { {-1,{0}} } }, + { MP_CMD_AF_CMDLINE, "af_cmdline", 2, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, { 0, NULL, 0, {} } }; diff --git a/input/input.h b/input/input.h index 7aa5af0f55..51d9f6522e 100644 --- a/input/input.h +++ b/input/input.h @@ -156,6 +156,7 @@ typedef enum { MP_CMD_AF_ADD, MP_CMD_AF_DEL, MP_CMD_AF_CLR, + MP_CMD_AF_CMDLINE, } mp_command_type;