summaryrefslogtreecommitdiffstats
path: root/player/configfiles.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Remove DVD and Bluray support"wm42014-07-151-0/+6
| | | | | | This reverts commit 4b93210e0c244a65ef10a566abed2ad25ecaf9a1. *shrug*
* Remove DVD and Bluray supportwm42014-07-141-6/+0
| | | | It never worked well. Just remux your DVD and BD images to mkv.
* Audit and replace all ctype.h useswm42014-07-011-2/+2
| | | | | | | | | | | | | | | | Something like "char *s = ...; isdigit(s[0]);" triggers undefined behavior, because char can be signed, and thus s[0] can be a negative value. The is*() functions require unsigned char _or_ EOF. EOF is a special value outside of unsigned char range, thus the argument to the is*() functions can't be a char. This undefined behavior can actually trigger crashes if the implementation of these functions e.g. uses lookup tables, which are then indexed with out-of-range values. Replace all <ctype.h> uses with our own custom mp_is*() functions added with misc/ctype.h. As a bonus, these functions are locale-independent. (Although currently, we _require_ C locale for other reasons.)
* config, player: avoid some temporary talloc contextswm42014-06-261-15/+10
| | | | | IMO a semi-bad concept, that the mpv code unfortunately uses way too much.
* player: create config dir if it doesn't existwm42014-06-261-0/+2
| | | | | | | This was dropped in the commit adding XDG support, probably accidentally. Also normalize some whitespace.
* player: remove some minor code duplication in config loader codewm42014-06-261-18/+14
| | | | | | | It's better to keep the logic in one place. Also drop that a broken config file aborts loading of the player. I don't see much reason for this, and it inflates the code slightly.
* Basic xdg directory implementationKenneth Zhou2014-06-261-14/+19
| | | | | | | | | | Search $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS for config files. This also negates the need to have separate user and global variants of mp_find_config_file() Closes #864, #109. Signed-off-by: wm4 <wm4@nowhere>
* encode: make option struct localwm42014-06-111-1/+3
| | | | Similar to previous commits.
* Add more constwm42014-06-111-1/+1
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* stream_dvd, stream_dvdnav, stream_bluray: remove global option variableswm42014-06-111-6/+4
|
* player: write file name to the watch later config fileAlessandro Ghedini2014-06-011-0/+2
| | | | | | | | | This simply writes the file name as a comment to the top of the watch later config file. It can be useful to the user for determining whether a watch later config file can be manually removed (e.g. in case the corresponding media file has been deleted) or not.
* player: don't complain on too long filenameswm42014-05-101-2/+2
| | | | | | | | | mpv supports per-file config files, basically filename+".conf". We use a static buffer for the new filename, and if that buffer is too small, we print a warning. This is confusing for e.g. long URLs, so just hide the warning by default. Why not dynamically allocate the buffer? Who cares.
* encode: don't apply default config optionswm42014-04-191-4/+17
| | | | | | | | | | | | Often, user configs set options that are not suitable for encoding. Usually, playback and encoding are pretty different things, so it makes sense to keep them strictly separate. There are several possible solutions. The approach taken by this commit is to basically ignore the default config settings, and switch to an [encoding] config profile section instead. This also makes it impossible to have --o in a config file, because --o enables encode mode. See github issue #727 for discussion.
* build: simplify libavfilter configure checkswm42014-03-161-1/+1
| | | | | This is all not needed anymore. In particular, remove all configure switches except --enable-libavfilter.
* config: don't load global config files with --config-dirwm42014-02-281-1/+2
| | | | This sidestepped the usual logic by hardcoding the path.
* config: when writing resume config, read options, not propertieswm42014-02-251-33/+33
| | | | | | | | | | | This lowers the number of data stored in the resume config a bit further, because some properties can't be read at program start and when e.g. the VO wasn't created yet. Some fields still need to be read from a property (actually only "volume-restore-data", a hack to save the full volume information). So abuse the "options/" property, and make use of the fact that changing things at runtime also changes the options.
* config: don't save options to resume-config that didn't changewm42014-02-251-5/+28
| | | | | | | | | | | | | | | | This is approximate: we read each option value on program start (before starting playback of a file), and when writing the resume config, compare each value to the current state. This also means when a value is changed and then changed back, it's not stored. In particular, option values set in config files and on the command line are considered the default. This should help reducing the numbers of options overridden by the resume config. If too much is overridden, it becomes an inconvenience, because changes in config files will apparently have no effect when resuming a file. Also see github issue #574.
* config: don't write default config filewm42014-02-251-13/+3
| | | | | | This created an essentially empty config file. This is not really needed and probably causes more trouble than it solves (such as littering the home directory with crap), so get rid of it.
* player: load encoding-profiles.conf before the main configwm42014-01-011-7/+7
| | | | Otherwise one can't add profiles based on the encoding profiles.
* Install encoding-profiles.conf by defaultwm42013-12-281-9/+26
| | | | | | | | | | | | This is probably useful. Note that this includes a small, stupid hack to prevent loading of the config file if vf_lavfi is not available. The profile by default uses vf_lavfi, and the config parser will output errors if vf_lavfi is not available. As another caveat, we install the example profile even if encoding is disabled (though we don't load it, since this would print errors).
* player: fix buggy error condition when loading mpv.confwm42013-12-281-1/+1
|
* player: simplify mp_load_per_file_configwm42013-12-221-8/+7
| | | | | Get rid of the stupid and error-prone buffer size calculations, use snprintf instead of strcpy.
* player: move code aroundwm42013-12-221-41/+37
| | | | | | The only thing that used mp_load_per_file_config() was inside configfiles.c too, so remove the declaration from core.h and move the function before its use.
* player: remove code duplication for auto-loaded config profileswm42013-12-221-60/+14
| | | | | | Code for loading "[vo.vdpau]" profiles and similar. The messages printed on loading change, but other than that, everything should behave about the same.
* path lookup functions: mp_msg conversionswm42013-12-211-43/+58
| | | | | | | | | | | | | | | | | There's a single mp_msg() in path.c, but all path lookup functions seem to depend on it, so we get a rat-tail of stuff we have to change. This is probably a good thing though, because we can have the path lookup functions also access options, so we could allow overriding the default config path, or ignore the MPV_HOME environment variable, and such things. Also take the chance to consistently add talloc_ctx parameters to the path lookup functions. Also, this change causes a big mess on configfiles.c. It's the same issue: everything suddenly needs a (different) context argument. Make it less wild by providing a mp_load_auto_profiles() function, which isolates most of it to configfiles.c.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-2/+2
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-5/+5
| | | | | | | | | 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.
* Rename mp_core.h to core.hwm42013-12-171-1/+1
| | | | Get rid of the mp_ prefix.
* Move mpvcore/player/ to player/wm42013-12-171-0/+354