summaryrefslogtreecommitdiffstats
path: root/options/m_property.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove some VLAswm42015-11-061-6/+4
| | | | | | | | 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 mechanismwm42015-05-221-48/+1
| | | | | | | We don't need two. This mechanism was basically for MPlayer, and it has expired its usefulness by now.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* m_property: memcpy(ptr, NULL, 0) is undefinedwm42015-03-231-1/+2
|
* options: fix parsing for options/af and options/vfwm42015-02-031-1/+4
| | | | | | | 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 typowm42014-11-211-1/+1
| | | | | | The wrong value was checked for an error. Oops. Found by Coverity.
* command: make sub-properties more flexiblewm42014-11-131-9/+7
| | | | | This makes it work with all kind of types, instead of just some simple ones.
* command: fix weird stuffwm42014-11-131-0/+1
| | | | | 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 unavailablewm42014-09-011-0/+2
| | | | | | | | | | 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 typewm42014-06-131-42/+66
| | | | | | | | | | | | | | | | | | | | | | | 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-propertieswm42014-04-111-19/+4
| | | | | | 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" propertywm42014-03-301-0/+14
| | | | | | | | | 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 pathswm42014-03-301-0/+14
| | | | | | 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 0wm42014-03-301-1/+2
| | | | Nice strtol() usage error.
* m_property: allow setting string properties via M_PROPERTY_SET_STRINGwm42014-03-031-2/+1
| | | | | | | | | | | | | | | | | 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 codewm42014-02-261-1/+1
| | | | This broke the client API.
* m_property: retrieve chapter lists etc. as mpv_nodewm42014-02-241-4/+54
| | | | | | 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_nodewm42014-02-241-0/+36
| | | | | | | | 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 codewm42014-02-241-10/+6
|
* command: don't use option name in propertieswm42014-02-231-15/+5
| | | | | | | | | | | | | 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-propertieswm42014-02-161-0/+77
| | | | | 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 mechanismwm42014-02-161-0/+61
| | | | | | | 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 conversionswm42013-12-211-1/+1
| | | | | | | | 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 conversionswm42013-12-211-17/+23
| | | | | 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/wm42013-12-171-2/+2
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-0/+382
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.