From 5318a1bea1e477033cd355e19be366f0504222e9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 Nov 2013 19:04:16 +0100 Subject: input: use separate type for command definitions Introduce a mp_cmd_def struct to define commands, instead of using mp_cmd for this. This way each command parameter can be a m_option, instead of m_option plus some more stuff. Define the ARG_ macros directly in terms of the OPT_ macros. Not sure if this makes it easier to read (maybe not, even if it looks simpler), but at least it makes it easier to add other option types. Another idea was adding a name for each parameter (so you could have named parameters), but not today. --- mpvcore/player/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mpvcore/player/command.c') diff --git a/mpvcore/player/command.c b/mpvcore/player/command.c index bb72ec4d9a..c2db56444e 100644 --- a/mpvcore/player/command.c +++ b/mpvcore/player/command.c @@ -2437,7 +2437,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (!cmd->raw_args) { for (int n = 0; n < cmd->nargs; n++) { - if (cmd->args[n].type.type == CONF_TYPE_STRING) { + if (cmd->args[n].type->type == CONF_TYPE_STRING) { cmd->args[n].v.s = mp_property_expand_string(mpctx, cmd->args[n].v.s); if (!cmd->args[n].v.s) -- cgit v1.2.3