diff --git a/command.c b/command.c index bda3e6755e..b736a56fde 100644 --- a/command.c +++ b/command.c @@ -1329,14 +1329,14 @@ static int mp_property_tv_color(m_option_t *prop, int action, void *arg, // Use option-to-property-bridge. (The property and option have the same names.) #define M_OPTION_PROPERTY(name) \ - {(name), mp_property_generic_option, &m_option_type_choice, 0, 0, 0, (name)} + {(name), mp_property_generic_option, &m_option_type_dummy, 0, 0, 0, (name)} // OPTION_PROPERTY(), but with a custom property handler. The custom handler // must let unknown operations fall back to mp_property_generic_option(). #define M_OPTION_PROPERTY_CUSTOM(name, handler) \ - {(name), (handler), &m_option_type_choice, 0, 0, 0, (name)} + {(name), (handler), &m_option_type_dummy, 0, 0, 0, (name)} #define M_OPTION_PROPERTY_CUSTOM_(name, handler, ...) \ - {(name), (handler), &m_option_type_choice, 0, 0, 0, (name), __VA_ARGS__} + {(name), (handler), &m_option_type_dummy, 0, 0, 0, (name), __VA_ARGS__} /// All properties available in MPlayer. /** \ingroup Properties diff --git a/m_property.c b/m_property.c index acdf91200c..1644dbd997 100644 --- a/m_property.c +++ b/m_property.c @@ -35,6 +35,10 @@ #include "mp_msg.h" #include "mpcommon.h" +const struct m_option_type m_option_type_dummy = { + .name = "Unknown", +}; + static int do_action(const m_option_t *prop_list, const char *name, int action, void *arg, void *ctx) { @@ -59,7 +63,9 @@ static int do_action(const m_option_t *prop_list, const char *name, return M_PROPERTY_UNKNOWN; int (*control)(const m_option_t*, int, void*, void*) = prop->p; int r = control(prop, action, arg, ctx); - if (action == M_PROPERTY_GET_TYPE && r < 0) { + if (action == M_PROPERTY_GET_TYPE && r < 0 && + prop->type != &m_option_type_dummy) + { *(struct m_option *)arg = *prop; return M_PROPERTY_OK; } diff --git a/m_property.h b/m_property.h index 94dd36f050..462068987c 100644 --- a/m_property.h +++ b/m_property.h @@ -23,6 +23,8 @@ struct m_option; +extern const struct m_option_type m_option_type_dummy; + enum mp_property_action { // Get the property type. This defines the fundamental data type read from // or written to the property.