summaryrefslogtreecommitdiffstats
path: root/mpvcore/m_config.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix some more -Wshadow warningswm42013-11-011-8/+8
| | | | | | These aren't printed with newer gcc or clang versions for some reason. All of them seem to be about local variables shadowing global functions.
* options: fix positional suboption asrgumentswm42013-11-011-2/+2
| | | | | | | | | E.g. "-vf scale=848:480" set the w argument twice, instead of setting w and then h. This was caused by accidental shadowing of a local variable. Regression since probably 4cd143e.
* options: don't let watch_later etc. overwite command line optionswm42013-10-251-1/+18
| | | | | | | | | | | | | | | There are certain cases where mpv will automatically set options, such as per-file configs, per protocol/VO/AO/extension profiles, and watch_later resume configs. All these were overwriting the user's options, even when they were specified on command line. Add something that explicitly preserves command line options. This means you can now actually use the command line to override any options that the playback resume functionality backups and restores. It still happily overrides options set at runtime (e.g. changed via properties while playing a file; then playing the next file might override them again), but maybe that's not a problem with typical use.
* m_config: slightly improve name handlingwm42013-10-251-15/+9
|
* m_config: remove unused fieldswm42013-10-251-5/+1
| | | | | We don't need that anymore, because the old way to get default values by recreating the m_config is gone.
* m_config: allow not allocating option struct, and use itwm42013-10-251-6/+17
| | | | | | | In cases we're just listing options or checking their values (as it happens with -vo/-vf etc. suboption parsing), we don't need to allocate abd initialize the actual option struct. All we're interested in is the list of options.
* m_config: refactor option defaults handlingwm42013-10-241-59/+39
| | | | | | | | | | | | | Keep track of the default values directly, instead of creating a new instance of the option struct just to get the defaults. Also get rid of the special handling of m_obj_desc.init_options. Instead, handle it purely by the option parser. Originally, I wanted to handle --vo=opengl-hq and --vo=direct3d_shaders with this (by making them aliases to the real VOs with a different preset), but since --vo =opengl-hq=help prints the wrong values (as consequence of the simplification), I'm not doing that, and instead use something different.
* m_config: don't require dragging along parent in initializationwm42013-10-241-14/+19
| | | | | | Instead, track the opstruct explicitly. It turns out we don't need the parent at all. Also, add something rudimentary to track the default values.
* m_config: minor simplificationwm42013-10-241-9/+7
| | | | I think in this case, having a separate function is confusing.
* m_config: store m_config_options in an array instead of a listwm42013-10-241-46/+38
| | | | | | | | Might reduce memory overhead, and is also less annoying. Since pointers to m_config_options are kept around, this assumes they're added only during initialization. Otherwise you'd get dangling pointers.
* m_config: refactor initialization, reduce amount of malloc'ed stringswm42013-10-241-46/+46
| | | | | Allocate strings only if needed (when we have to prefix sub-options). Prepare for storing m_config_options in an array instead of a list.
* m_config: slightly simplify dynamic option initializationwm42013-10-241-2/+1
| | | | | | We can assume memcpy is enough, because the source should be from static data. (It wouldn't work if the data could contain pointers back into itself.)
* m_config: don't allow aliasing with string optionswm42013-10-241-12/+7
| | | | | | Minor simplification. String options are now not allowed to use the same variable/field anymore. (Also affects other "dynamic" options which require memory allocation.)
* m_config: cosmetics: make code less verbosewm42013-10-241-7/+2
|
* parser-cfg: use bstr everywhere after parsing stagewm42013-10-141-2/+2
| | | | | | Until now it used both char[] and bstr variants in the same code, which was nasty. For example, the next commit would have additionally required using memmove() to remove the prefix from the char[] string.
* talloc: change talloc destructor signaturewm42013-10-131-2/+1
| | | | | | | | | | | | | Change talloc destructor so that they can never signal failure, and don't return a status code. This makes our talloc copy even more incompatible to upstream talloc, but on the other hand this is preparation for getting rid of talloc entirely. (The talloc replacement in the next commit won't allow the talloc_free equivalent to fail, and the destructor return value would be useless. But I don't want to change any mpv code either; the idea is that the talloc replacement commit can be reverted for some time in order to test whether the talloc replacement introduced a regression.)
* m_option: rename struct member named "new"wm42013-08-191-2/+2
| | | | | | Cosmetic change to allow C++ code to include this header. See github issue #195.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-2/+2
| | | | Followup commit. Fixes all the files references.
* core: move contents to mpvcore (1/2)Stefano Pigozzi2013-08-061-0/+777
core is used in many unix systems for core dumps. For that reason some tools work under the assumption that the file is indeed a core dump (for example autoconf does this). This commit just renames the files. The following one will change all the includes to fix compilation. This is done this way because git has a easier time tracing file changes if there is a pure rename commit.