aboutsummaryrefslogtreecommitdiffhomepage
path: root/options/m_property.c
Commit message (Collapse)AuthorAge
* command: add options to property listGravatar wm42016-09-01
| | | | | | | | | | | Now options are accessible through the property list as well, which unifies them to a degree. Not all options support runtime changes (meaning affected components need to be restarted for the options to take effects). Remove from the manpage those properties which are cleanly mapped to options anyway. From the user-perspective they're just options available through the property interface.
* m_property: remove pointless explicitly clampingGravatar wm42016-08-31
| | | | | | | | | This is basically dead code, and even the commit that added this code 4 years ago said that this should be for debugging only. (Though it is possible that the clamp callback was used for something else, and then unused again. Also, some of the clamping code remains and is used for internal checking, e.g. clamp_double().)
* command: fix cycling certain propertiesGravatar wm42016-04-15
| | | | | | | Commit a9bd4535 generally changed properties are set to string values. This actually broke the fallback for non-string properties, because the set string action was redirected directly to the property, instead of the generic handler and its fallback code.
* client API: improve mpv_set_property() handling of MPV_FORMAT_NODEGravatar wm42016-04-15
| | | | | | | | | If a mpv_node wrapped a string, the behavior was different from calling mpv_set_property() with MPV_FORMAT_STRING directly. Change this. The original intention was to be strict about types if MPV_FORMAT_NODE is used. But I think the result was less than ideal, and the same change towards less strict behavior was made to mpv_set_option() ages ago.
* mpv_talloc.h: rename from talloc.hGravatar Dmitrij D. Czarkoff2016-01-11
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* Remove some VLAsGravatar wm42015-11-06
| | | | | | | | They are evil and should be eradicated. Some of these were pretty dumb anyway. There are probably some more around in platform specific code or other code not enabled by default on Linux.
* command: remove old property deprecation warning mechanismGravatar wm42015-05-22
| | | | | | | We don't need two. This mechanism was basically for MPlayer, and it has expired its usefulness by now.
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* m_property: memcpy(ptr, NULL, 0) is undefinedGravatar wm42015-03-23
|
* options: fix parsing for options/af and options/vfGravatar wm42015-02-03
| | | | | | | Basically, the declared option name and the name passed to the parse_obj_settings_list() must be the same. Fixes the issue addressed in #1550, but differently.
* m_property: fix a typoGravatar wm42014-11-21
| | | | | | The wrong value was checked for an error. Oops. Found by Coverity.
* command: make sub-properties more flexibleGravatar wm42014-11-13
| | | | | This makes it work with all kind of types, instead of just some simple ones.
* command: fix weird stuffGravatar wm42014-11-13
| | | | | Happens to fix some aspects of some properties (especially reading "option-flags/x" as native value).
* command: make m_property_strdup_ro with NULL mean unavailableGravatar wm42014-09-01
| | | | | | | | | | This catches a few cases which basically call: m_property_strdup_ro(..., ..., NULL) which would return NULL strings. This should generally be avoided (although it's allowed due to reasons), and it seems most callers actually intend this to mean M_PROPERTY_UNAVAILABLE.
* command: redo the property typeGravatar wm42014-06-13
| | | | | | | | | | | | | | | | | | | | | | | Instead of absuing m_option to store the property list, introduce a separate type for properties. m_option is still used to handle data types. The property declaration itself now never contains the option type, and instead it's always queried with M_PROPERTY_GET_TYPE. (This was already done with some properties, now all properties use it.) This also fixes that the function signatures did not match the function type with which these functions were called. They were called as: int (*)(const m_option_t*, int, void*, void*) but the actual function signatures were: int (*)(m_option_t*, int, void*, MPContext *) Two arguments were mismatched. This adds one line per property implementation. With additional the reordering of the parameters, this makes most of the changes in this commit.
* command: remove extended information from --list-propertiesGravatar wm42014-04-11
| | | | | | This used to display the property type, but it was not always correct or even available. The way the property mechanism works, we can know this only at runtime.
* command: fix access to "metadata/list" propertyGravatar wm42014-03-30
| | | | | | | | | The function tag_property() in command.c passed a key action with empty path to m_property_read_list. This is normally not valid, because key actions are supposed to access sub-paths. But it's kind of inconvenient to check for this case in tag_property(). So make it valid by providing a m_property_unkey() function, which turns a key access to "" into a top-level action.
* command: add helper function to split property pathsGravatar wm42014-03-30
| | | | | | We've just checked whether a sub-path started with "name/", but that changes behavior whether the property name has a trailing '/' or not. Using a helper function to split of path components avoids this problem.
* m_property: don't parse empty string as 0Gravatar wm42014-03-30
| | | | Nice strtol() usage error.
* m_property: allow setting string properties via M_PROPERTY_SET_STRINGGravatar wm42014-03-03
| | | | | | | | | | | | | | | | | Setting string options to strings over the m_option fallback (i.e. M_PROPERTY_SET_STRING is called if the option type is CONF_TYPE_STRING) failed. This was because m_option_parse() returns 0. 0 still means success, but the property code tried to be clever, and considered 0 not a success in order to disallow setting flags to an emtpy string (which in turn is allowed, because the command line allows flag options without parameters). Fix this by removing the overly clever code. This could happen when e.g. using the "set" command on options/title (a string option), and also was a problem for the client API. Closes #610.
* m_property: fix confused error codeGravatar wm42014-02-26
| | | | This broke the client API.
* m_property: retrieve chapter lists etc. as mpv_nodeGravatar wm42014-02-24
| | | | | | This automatically allows accessing properties like chapter-list and track-list to be read as mpv_node. This affects all properties which use m_property_read_sub() and m_property_read_list().
* m_property: add mechanism to access properties as mpv_nodeGravatar wm42014-02-24
| | | | | | | | Allows retrieving properties by their native values (or something close to it), rather than having to go through string conversion. The caller could actually just copy the value itself and then use the m_option functions to convert it to mpv_node, but maybe it's more flexible this way.
* m_property: simplify some codeGravatar wm42014-02-24
|
* command: don't use option name in propertiesGravatar wm42014-02-23
| | | | | | | | | | | | | Some code accessed m_option.name to get the property name. (Maybe only show_property_osd() had a significant use of it.) Remove that, and remove setting names and dummy names as well. The old code usually assumed that the name was set, and show_property_osd() used it to get the proper name of deprecated aliases. The "vf" property was listed as "vf*". Not sure why that was done, but it works without anyway.
* m_property: add a mechanism to organize a list of sub-propertiesGravatar wm42014-02-16
| | | | | This automatically adds a "count" sub-property, and for each entry in the range [0, count), a numbered sub-property to access the item.
* m_property: add a sub-property mechanismGravatar wm42014-02-16
| | | | | | | This adds a mechanism for easier export of sub-properties. The following commits will make use of it to export fine grained information about certain things. The sub-property mechanism reduces the amount of code needed to export a data value to 1 line.
* m_option, m_config: mp_msg conversionsGravatar wm42013-12-21
| | | | | | | | Always pass around mp_log contexts in the option parser code. This of course affects all users of this API as well. In stream.c, pass a mp_null_log, because we can't do it properly yet. This will be fixed later.
* m_property: mp_msg conversionsGravatar wm42013-12-21
| | | | | Includes some semi-crappy hacks to avoid changing too much code for this conversion (allowing NULL log argument for m_property_do()).
* Split mpvcore/ into common/, misc/, bstr/Gravatar wm42013-12-17
|
* Move options/config related files from mpvcore/ to options/Gravatar wm42013-12-17
Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.