diff options
-rw-r--r-- | options/options.c | 4 | ||||
-rw-r--r-- | player/command.c | 23 |
2 files changed, 8 insertions, 19 deletions
diff --git a/options/options.c b/options/options.c index b7f2357ebe..a874e95483 100644 --- a/options/options.c +++ b/options/options.c @@ -702,9 +702,9 @@ static const m_option_t mp_opts[] = { OPT_FLAG("input-terminal", consolecontrols, UPDATE_TERM), - OPT_STRING("input-file", input_file, M_OPT_FILE | UPDATE_INPUT, + OPT_STRING("input-file", input_file, M_OPT_FILE, .deprecation_message = "use --input-ipc-server"), - OPT_STRING("input-ipc-server", ipc_path, M_OPT_FILE | UPDATE_INPUT), + OPT_STRING("input-ipc-server", ipc_path, M_OPT_FILE), OPT_SUBSTRUCT("screenshot", screenshot_image_opts, screenshot_conf, 0), OPT_STRING("screenshot-template", screenshot_template, 0), diff --git a/player/command.c b/player/command.c index b31b42e9bc..81b1bb810c 100644 --- a/player/command.c +++ b/player/command.c @@ -101,9 +101,6 @@ struct command_ctx { struct ao_hotplug *hotplug; - char *cur_ipc; - char *cur_ipc_input; - struct mp_cmd_ctx *cache_dump_cmd; // in progress cache dumping }; @@ -5964,8 +5961,8 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, { struct MPContext *mpctx = ctx; struct MPOpts *opts = mpctx->opts; - struct command_ctx *cmd = mpctx->command_ctx; - void *opt_ptr = co ? co->data : NULL; // NULL on start + bool init = !co; + void *opt_ptr = init ? NULL : co->data; // NULL on start if (co) mp_notify_property(mpctx, co->name); @@ -6001,20 +5998,12 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, } } - if (flags & UPDATE_INPUT) { + if (flags & UPDATE_INPUT) mp_input_update_opts(mpctx->input); - // Rather coarse change-detection, but sufficient effort. - if (!bstr_equals(bstr0(cmd->cur_ipc), bstr0(opts->ipc_path)) || - !bstr_equals(bstr0(cmd->cur_ipc_input), bstr0(opts->input_file))) - { - talloc_free(cmd->cur_ipc); - talloc_free(cmd->cur_ipc_input); - cmd->cur_ipc = talloc_strdup(cmd, opts->ipc_path); - cmd->cur_ipc_input = talloc_strdup(cmd, opts->input_file); - mp_uninit_ipc(mpctx->ipc_ctx); - mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); - } + if (init || opt_ptr == &opts->ipc_path || opt_ptr == &opts->input_file) { + mp_uninit_ipc(mpctx->ipc_ctx); + mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); } if (flags & UPDATE_AUDIO) |