From 1e6c57d4e437b403eab89d07ab61b872253b2c35 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 Nov 2019 20:06:19 +0100 Subject: m_config: move stuff around Create a separate struct for internal fields of m_config_cache, so API users can't just mess with stuff they shouldn't access. Move the ts field out of m_config_data, so we don't need unnecessary atomics in one case. This is just preparation, and shouldn't change any behavior. --- options/m_config.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'options/m_config.h') diff --git a/options/m_config.h b/options/m_config.h index 120a82b768..42734e8000 100644 --- a/options/m_config.h +++ b/options/m_config.h @@ -35,6 +35,7 @@ struct m_sub_options; struct m_obj_desc; struct m_obj_settings; struct mp_log; +struct mp_dispatch_queue; // Config option struct m_config_option { @@ -263,20 +264,11 @@ struct mpv_node m_config_get_profiles(struct m_config *config); // the cache itself is allowed. struct m_config_cache { // The struct as indicated by m_config_cache_alloc's group parameter. - // (Internally the same as data->gdata[0]->udata.) + // (Internally the same as internal->gdata[0]->udata.) void *opts; - // Internal. - struct m_config_shadow *shadow; // real data - struct m_config_data *data; // copy for the cache user - bool in_list; // registered as listener with root config - // --- Implicitly synchronized by setting/unsetting wakeup_cb. - struct mp_dispatch_queue *wakeup_dispatch_queue; - void (*wakeup_dispatch_cb)(void *ctx); - void *wakeup_dispatch_cb_ctx; - // --- Protected by shadow->lock - void (*wakeup_cb)(void *ctx); - void *wakeup_cb_ctx; + // Do not access. + struct config_cache *internal; }; #define GLOBAL_CONFIG NULL -- cgit v1.2.3