diff options
author | wm4 <wm4@nowhere> | 2016-09-06 20:09:44 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-06 20:09:44 +0200 |
commit | 9f0e7bb9982eef36bf2f14fd750bbe6a359011ba (patch) | |
tree | 61685746bd26bc953e55d37e39bde31b10ff916c /input/input.c | |
parent | e66c098228320bdcc13ca975125f7b98b0f23219 (diff) | |
download | mpv-9f0e7bb9982eef36bf2f14fd750bbe6a359011ba.tar.bz2 mpv-9f0e7bb9982eef36bf2f14fd750bbe6a359011ba.tar.xz |
input, demux_tv: remove some older option access methods
Diffstat (limited to 'input/input.c')
-rw-r--r-- | input/input.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/input/input.c b/input/input.c index e93fc6ec17..f820b8b174 100644 --- a/input/input.c +++ b/input/input.c @@ -99,6 +99,7 @@ struct input_ctx { sem_t wakeup; struct mp_log *log; struct mpv_global *global; + struct m_config_cache *opts_cache; struct input_opts *opts; bool using_alt_gr; @@ -1201,12 +1202,14 @@ struct input_ctx *mp_input_init(struct mpv_global *global) struct input_ctx *ictx = talloc_ptrtype(NULL, ictx); *ictx = (struct input_ctx){ .global = global, - .opts = talloc_zero(ictx, struct input_opts), // replaced later .ar_state = -1, .log = mp_log_new(ictx, global->log, "input"), .mouse_section = "default", + .opts_cache = m_config_cache_alloc(ictx, global, &input_config), }; + ictx->opts = ictx->opts_cache->opts; + if (sem_init(&ictx->wakeup, 0, 0)) { MP_FATAL(ictx, "mpv doesn't work on systems without POSIX semaphores.\n"); abort(); @@ -1223,11 +1226,9 @@ struct input_ctx *mp_input_init(struct mpv_global *global) void mp_input_load(struct input_ctx *ictx) { - struct input_opts *input_conf = - m_sub_options_copy(ictx, &input_config, ictx->global->opts->input_opts); + struct input_opts *input_conf = ictx->opts; - talloc_free(ictx->opts); - ictx->opts = input_conf; + m_config_cache_update(ictx->opts_cache); // "Uncomment" the default key bindings in etc/input.conf and add them. // All lines that do not start with '# ' are parsed. |