From 816ad035191970decb17086f5c011edffc257b6c Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 21 May 2018 13:45:06 +0200 Subject: m_config: remove extra default_data field Just wastes memory (a few KB, because there are so many options). --- player/command.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index 629ff234e2..e836b3ef21 100644 --- a/player/command.c +++ b/player/command.c @@ -3732,12 +3732,13 @@ static int mp_property_option_info(void *ctx, struct m_property *prop, struct m_config_option *co = m_config_get_co(mpctx->mconfig, key); if (!co) return M_PROPERTY_UNKNOWN; + const struct m_option *opt = co->opt; union m_option_value def = {0}; - if (co->default_data) - memcpy(&def, co->default_data, co->opt->type->size); + const void *def_ptr = m_config_get_co_default(mpctx->mconfig, co); + if (def_ptr && opt->type->size > 0) + memcpy(&def, def_ptr, opt->type->size); - const struct m_option *opt = co->opt; bool has_minmax = opt->type == &m_option_type_int || opt->type == &m_option_type_int64 || -- cgit v1.2.3