win32-console-wrapper: Fix heap corruption

FUCK the Windows API.
w32_common: use OLE DnD for text/uri-list support

Signed-off-by: Martin Herkt <lachs0r@srsfckn.biz>
w32_common: reformat slightly

This really needs more whitespace.
win32-console-wrapper: remove command line mangling

This wasn't really necessary and caused a lot of problems.
win32-console-wrapper: use child process exit code
Windows: use roaming AppData instead of local

Whatever. Fixes #458.
w32_common: don't force topmost on fullscreen

Fixes #457, #444.
cocoa: don't reset window size when the video size doesn't change

Fixes #459
w32_common: reformat yet again

I've been told mpv prefers switch/case on the same indent level.
Sorry about the noise :P
Fix subtitle delay inversion
sub: fix previous commit

sub_seek and sub_step were broken.
Fix audio delay inversion
audio: fix previous commit
demux_lavf: fix minor memory leak
wayland: fix some memory leaks on initialization failure

This commonly happens when initializing vo_opengl on a X11-only system.

Unfortunately, most wl_*_destroy() functions appear not to accept NULL
pointers, making partial deinitialization a pain: you have to add your
own NULL checks everywhere to avoid crashes.

xkb.context is uninitialized separately, because you can initialize it
just fine, even if the rest of input initialization fails.
wayland: silence annoying libwayland-client message

libwayland-client contains the following code [1]:

	runtime_dir = getenv("XDG_RUNTIME_DIR");
	if (!runtime_dir) {
		fprintf(stderr,
			"error: XDG_RUNTIME_DIR not set in the environment.\n");

This means this message will unconditionally and unavoidably be printed
if XDG_RUNTIME_DIR is not set. Since mpv is a terminal program, and we
want to avoid unnecessary output, work it around by not attempting to
use wayland if this environment variable is not set.

[1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-client.c#n636
    (cd0dccd01e16fa404e03974d30ded3aebdb1c4bc)
manpage: mention how to get a list of codecs for use with --hwdec-codecs
wayland: fix fullscreen & resizing for good

I added enough logic to never set ontop or fullscreen twitce.
This commit keeps also the size of the video if multiple videos are played.
If the ratio differs the width will be kept at the same size and only the
height changes.
ao_pulse: add suboption to control buffer size
ao_pulse: lower default buffer size from 1000ms to 250ms

1000ms is a bit insane. It makes behavior on playback speed changes
worse (because the player has to catch up the dropped audio due to
audio-chain reset), and perhaps makes seeking slower.

Note that the problem of playback speed changes misbehaving will be
fixed in the future, but even then we don't want to have a buffer that
large.