win32: add missing priority classes
video: Add BT.2020-NCL colorspace and transfer function

Source: http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf
video: Add support for non-BT.709 primaries

This add support for reading primary information from lavc, categorized
into BT.601-525, BT.601-625, BT.709 and BT.2020; and passes it on to the
vo. In vo_opengl, we always generate the 3dlut against the wider BT.2020
and transform our source into this colorspace in the shader.
options: Expose --colormatrix-primaries to the user

Signed-off-by: wm4 <wm4@nowhere>
video: Support BT.2020 constant luminance system

Signed-off-by: wm4 <wm4@nowhere>
video: Generate an accurate CMS matrix instead of hard-coding

This also avoids an extra matrix multiplication when using :srgb, making
that path both more efficient and also eliminating more hard-coded
values.

In addition, the previously hard-coded XYZ to RGB matrix will be
dynamically generated.
video: Better support for XYZ input

With this change, XYZ input is directly converted to the output
colorspace wherever possible, and to the colorspace specified by the
tags and/or --primaries option, otherwise.

This commit also restructures some of the CMS code in gl_video.c to
hopefully make it clearer which decision is being done where and why.
video: Refactor rendering intent for DCP XYZ and :srgb

Notably, we now conform to SMPTE 428-1-2006 when decoding XYZ12 input,
and we can support rendering intents other than colorimetric when
converting between BT.709 and BT.2020, like with :srgb or :icc-profile.
video: Include better heuristics for guessing primaries

These consult the vertical resolution, matching against 576 for
PAL and 480/486 for NTSC. The documentation has also been updated.

Signed-off-by: wm4 <wm4@nowhere>
vo_opengl: Make approx-gamma affect OSD/sub

Close #837

Signed-off-by: wm4 <wm4@nowhere>
demux_lavf: remove unused symbol
cache: change auto-pause/resume defaults

This is hopefully better for web streams.

Temporary workaround for #870.
manpage: update changed defaults from previous commit

Oops.
command: fix tv-channel property

Now it's at least actually relayed to the TV code. I didn't/couldn't
test whether it actually works, though.
DOCS: add document describing the release policy and procedure
input: readd some TV default key bindings

Requested by a user. Closes #878.
Basic xdg directory implementation

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>
player: remove some minor code duplication in config loader code

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.
config: prefer the old config dir if it exists, but XDG doesn't

This means normally the XDG config dir will be used. But if the old
config dir (~/.mpv) exists and the XDG config dir does not, then don't
create it.

To simplify the code, also make mp_path_exists() accept NULL paths. In
that case it's considered as not existing. (Funnily, on Linux this
already worked, because the string is passed directly to the kernel,
and the kernel will just return EFAULT on invalid memory.)
player: create config dir if it doesn't exist

This was dropped in the commit adding XDG support, probably
accidentally.

Also normalize some whitespace.