diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-10-17 15:54:55 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:18:37 +0200 |
commit | dbd5feedd5f88a69b47b3bdaf0086329805d3c56 (patch) | |
tree | e9a5749bc726e3819029ee124712076539a12aec | |
parent | 3452e2e907943dce4aeb4659f08bb2f966ea43ec (diff) | |
download | mpv-dbd5feedd5f88a69b47b3bdaf0086329805d3c56.tar.bz2 mpv-dbd5feedd5f88a69b47b3bdaf0086329805d3c56.tar.xz |
new slave command: af_cmdline, for changing audio filter options
Add experimental af_cmdline slave command to allow changing filter
options at runtime.
Patch by Adrian Stutz [adrian sttz ch]
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32505 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | DOCS/tech/slave.txt | 3 | ||||
-rw-r--r-- | command.c | 13 | ||||
-rw-r--r-- | input/input.c | 1 | ||||
-rw-r--r-- | input/input.h | 1 |
4 files changed, 18 insertions, 0 deletions
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 <filter_arguments_list> (comma separated list of audio filters with para af_clr (experimental) Unload all loaded audio filters. +af_cmdline <filter_name> <filter_arguments> + (experimental) Send new command-line options to a filter with the given name. + af_del <filter_name_list> (comma separated list of audio filter's names) (experimental) Unload the first occurrence of the filters, if loaded. @@ -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; |