ao_wasapi: make code shorter

Also fix a format string mistake in a log call using it.

I wonder if this code shouldn't use FormatMessage, but it looks kind
of involved [1], so: no, thanks.

[1] http://support.microsoft.com/kb/256348/en-us
player: add missing "-" to options in workaround notice on A/V desynchronization

While it technically works, using GNU-style options seems cleaner nowadays.

Signed-off-by: wm4 <wm4@nowhere>
vf_eq: don't malloc priv struct

There wasn't any reason for this. In fact, it's a memory leak. The
proper priv struct is already allocated vf.c and the option parser.
osc: make OSC more responsive when paused

Quick hack to impove situtation until the next major overhaul
comes
m_property: don't parse empty string as 0

Nice strtol() usage error.
command: add helper function to split property paths

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.
command: fix access to "metadata/list" property

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: minor simplification
command: change what the metadata property returns

Change the type of the property from a string list (alternating
key/value entries) to a map. Using the client API, this will return
MPV_FORMAT_NODE_MAP, while Lua mp.get_property_native returns a
dictionary-like table.
command: allow changing filters before video chain initialization

Apparently this is more intuitive.

Somewhat tricky, because of the odd state after loading a file but
before initializing the VO.
encode_lavc: copy metadata to output file

Closes #684

Signed-off-by: wm4 <wm4@nowhere>

Includes some minor cosmetic changes additional to the original PR.
ass_mp: don't use --subcp for --ass-styles

The --ass-styles option is implemented by calling ass_read_styles().
This function can take a codepage (so libass will use iconv to convert
it). This was implemented before our --subcp option was changed, and
this code was not updated. Now libass fails opening iconv, because
--subcp is not always (and not by default) a valid iconv codepage.

Just always pass NULL, which means the file passed to --ass-styles must
be in UTF-8. The --ass-styles option is a fringe option anyway (and will
destroy your subtitles), so having codepage support for it isn't
important at all.
vo_opengl, cocoa: allow to autoselect a color profile

This commit adds support for automatic selection of color profiles based on
the display where mpv is initialized, and automatically changes the color
profile when display is changed or the profile itself is changed from
System Preferences.

@UliZappe was responsible with the testing and implementation of a lot of this
commit, including the original implementation of `cocoa_get_icc_profile_path`
(See #594).

Fixes #594
vo_corevideo: remove unused variable
gl_lcms: fix build when lcms2 is not available

Was broken in b0ee9334e.
DOCS/encoding: make "What does not work yet" a proper RST section
lua: add mp.unregister_event() function

Someone requested this... I think.
lua: give more control over timers

Now they can be paused and resumed.

Since pausing and disabling the timer is essentially the same underlying
operation, we also just provide one method for it.

mp.cancel_timer probably still works, but I'm considering this
deprecated, and it's removed from the manpage. (We didn't have a release
with this function yet, so no formal deprecation.)
remove redundant/outdated line from encodeing.rst:"what works"
vo_vdpau: more debugging output

Might help to debug certain problems with Mesa.