0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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
This commit is contained in:
reimar 2010-10-17 15:54:55 +00:00 committed by Uoti Urpala
parent 3452e2e907
commit dbd5feedd5
4 changed files with 18 additions and 0 deletions

View File

@ -53,6 +53,9 @@ af_add <filter_arguments_list> (comma separated list of audio filters with para
af_clr af_clr
(experimental) Unload all loaded audio filters. (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) af_del <filter_name_list> (comma separated list of audio filter's names)
(experimental) Unload the first occurrence of the filters, if loaded. (experimental) Unload the first occurrence of the filters, if loaded.

View File

@ -3496,6 +3496,19 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
af_init(mpctx->mixer.afilter); af_init(mpctx->mixer.afilter);
build_afilter_chain(mpctx, sh_audio, &ao_data); build_afilter_chain(mpctx, sh_audio, &ao_data);
break; 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: default:
mp_msg(MSGT_CPLAYER, MSGL_V, mp_msg(MSGT_CPLAYER, MSGL_V,
"Received unknown cmd %s\n", cmd->name); "Received unknown cmd %s\n", cmd->name);

View File

@ -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_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_DEL, "af_del", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
{ MP_CMD_AF_CLR, "af_clr", 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, {} } { 0, NULL, 0, {} }
}; };

View File

@ -156,6 +156,7 @@ typedef enum {
MP_CMD_AF_ADD, MP_CMD_AF_ADD,
MP_CMD_AF_DEL, MP_CMD_AF_DEL,
MP_CMD_AF_CLR, MP_CMD_AF_CLR,
MP_CMD_AF_CMDLINE,
} mp_command_type; } mp_command_type;