From 8fc2aef3b7f95a10de01a9f441907b9cd5d41c45 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 26 Sep 2012 23:56:29 +0200 Subject: commands: don't use dummy option declaration for properties The property-to-option bridge (when properties change values normally set by the command line parser) uses M_PROPERTY_GET_TYPE to get the exact option type. In these cases, the entry in mp_properties[] is unused, except for the name field and the property callback. Instead, mp_property_generic_option() implements M_PROPERTY_GET_TYPE and returns the m_option as defined in cfg-mplayer.h. However, if a property is unavailable, mp_property_generic_option() is never actually called, and M_PROPERTY_GET_TYPE will return the dummy option entry. We could make sure that the dummy option entry equals the option entry defined in cfg-mplayer.h. But this would duplicate all information. Add a dummy option type m_option_type_dummy, which is used by entries using the property-to-option bridge. Make M_PROPERTY_GET_TYPE fail if this type is encountered. This dummy should never be used, as it isn --- m_property.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'm_property.h') 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. -- cgit v1.2.3