summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-21 13:45:06 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:35 +0200
commit816ad035191970decb17086f5c011edffc257b6c (patch)
tree9a5be112d6ff6cb585460d20d4e89c0724b1775f /player/command.c
parent3f061dd62912728bf152c06e7c27b43a3cef312d (diff)
downloadmpv-816ad035191970decb17086f5c011edffc257b6c.tar.bz2
mpv-816ad035191970decb17086f5c011edffc257b6c.tar.xz
m_config: remove extra default_data field
Just wastes memory (a few KB, because there are so many options).
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c7
1 files changed, 4 insertions, 3 deletions
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 ||