diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-12-18 08:02:48 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-12-18 11:59:09 +0200 |
commit | b9a3579ec980dfb01d0b952bf0b859ecdf62d7ea (patch) | |
tree | 9f90d981a92bb6cfb79e5feed1b3b9bfde9ab3b0 /m_config.c | |
parent | 7e366113f75c696ae2b32f5faa5f80ec3fca96b8 (diff) | |
download | mpv-b9a3579ec980dfb01d0b952bf0b859ecdf62d7ea.tar.bz2 mpv-b9a3579ec980dfb01d0b952bf0b859ecdf62d7ea.tar.xz |
commands: add generic option -> property wrapper
Add mp_property_generic_option(), a property function that can be used
for generic option-based properties that do not require any action
beyond manipulating the value of the option variable. Currently it
directly implements GET and SET, plus STEP_UP for "choice" options
only. Use it to add a property for -pts-association-mode (not
particularly useful in normal use, but serves as a test).
Diffstat (limited to 'm_config.c')
-rw-r--r-- | m_config.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/m_config.c b/m_config.c index 266ee10323..2752ced85f 100644 --- a/m_config.c +++ b/m_config.c @@ -150,7 +150,7 @@ static void m_option_save(const m_config_t *config, const m_option_t *opt, void *dst) { if (opt->type->save) { - const void *src = opt->new ? (char*)config->optstruct + opt->offset : opt->p; + const void *src = m_option_get_ptr(opt, config->optstruct); opt->type->save(opt, dst, src); } } @@ -159,7 +159,7 @@ static void m_option_set(const m_config_t *config, const m_option_t *opt, const void *src) { if (opt->type->set) { - void *dst = opt->new ? (char*)config->optstruct + opt->offset : opt->p; + void *dst = m_option_get_ptr(opt, config->optstruct); opt->type->set(opt, dst, src); } } |