summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-05-07 23:16:20 +0300
committerUoti Urpala <uau@mplayer2.org>2012-05-07 23:21:23 +0300
commitc02d0ee703a52f50c3763a0eda67cfea13e4c76a (patch)
tree985863fbaaaf96a15232b9c9d160527e87c7d381 /input
parent9bf03e8b65dbebb66d5e5b31efa4bae4324b05b2 (diff)
downloadmpv-c02d0ee703a52f50c3763a0eda67cfea13e4c76a.tar.bz2
mpv-c02d0ee703a52f50c3763a0eda67cfea13e4c76a.tar.xz
options: change --input=keylist, cmdlist implementation
Change the --input=keylist and --input=cmdlist suboptions to use the "print function" option type. This changes their semantics somewhat, and now some other output can appear after the printed lists (before, they called "exit(0)" directly). I'm not aware of any program parsing the output which could be affected.
Diffstat (limited to 'input')
-rw-r--r--input/input.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/input/input.c b/input/input.c
index 191b378deb..a6da6f324c 100644
--- a/input/input.c
+++ b/input/input.c
@@ -633,16 +633,16 @@ struct input_ctx {
int async_quit_request;
-static int print_key_list(m_option_t *cfg);
-static int print_cmd_list(m_option_t *cfg);
+static int print_key_list(m_option_t *cfg, char *optname, char *optparam);
+static int print_cmd_list(m_option_t *cfg, char *optname, char *optparam);
// Our command line options
static const m_option_t input_conf[] = {
OPT_STRING("conf", input.config_file, CONF_GLOBAL),
OPT_INT("ar-delay", input.ar_delay, CONF_GLOBAL),
OPT_INT("ar-rate", input.ar_rate, CONF_GLOBAL),
- { "keylist", print_key_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL },
- { "cmdlist", print_cmd_list, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL },
+ { "keylist", print_key_list, CONF_TYPE_PRINT_FUNC, CONF_NOCFG },
+ { "cmdlist", print_cmd_list, CONF_TYPE_PRINT_FUNC, CONF_NOCFG },
OPT_STRING("js-dev", input.js_dev, CONF_GLOBAL),
OPT_STRING("ar-dev", input.ar_dev, CONF_GLOBAL),
OPT_STRING("file", input.in_file, CONF_GLOBAL),
@@ -1897,16 +1897,16 @@ void mp_input_register_options(m_config_t *cfg)
m_config_register_options(cfg, mp_input_opts);
}
-static int print_key_list(m_option_t *cfg)
+static int print_key_list(m_option_t *cfg, char *optname, char *optparam)
{
int i;
printf("\n");
for (i = 0; key_names[i].name != NULL; i++)
printf("%s\n", key_names[i].name);
- exit(0);
+ return M_OPT_EXIT;
}
-static int print_cmd_list(m_option_t *cfg)
+static int print_cmd_list(m_option_t *cfg, char *optname, char *optparam)
{
const mp_cmd_t *cmd;
int i, j;
@@ -1935,7 +1935,7 @@ static int print_cmd_list(m_option_t *cfg)
}
printf("\n");
}
- exit(0);
+ return M_OPT_EXIT;
}
void mp_input_wakeup(struct input_ctx *ictx)