manpage: forced->used
manpage: fix grammar
Revert "wayland: print waylands display erros"

This reverts commit 6e34b0ec1f50612cb2767da3dbc27be0be63041d.

There has always been an error message "proxy already has a listener" and
I couldn't reproduce where it is comming from until now. The display interface
already has a listener and we can't overwrite it. Now remove the code and avoid
this error message.

Conflicts:
	video/out/wayland_common.c
osd: make code C99

This used an unnamed union, which is allowed in GNU C and C11, but not
C99. This broke the build with some older compilers.

Replaces pull request #744.
input: fix inverted condition

pthread_equal() returns 0 if the threads are not the same, and somehow
I got that wrong. The worst is that I actually explicitly checked the
manpage when I wrote this code.
input: fix mouse_leave/OSC behavior

This essentially reverts commit cca13efb. The code in the if was
supposed to be run only if the mouse button was down, because in this
case the mouse area is never considered to be left. Since it was run
for every mouse button, mouse_leave wasn't sent.

Fixes #745.
demux_mkv: enable parsing for VP9

VP9 packets can contain 2 frames in some video packets (from which 1
frame is invisible). Due to a design mismatch between libvpx and the
libavcodec vp9 decoder, libvpx can take the "full" packets, but lavc vp9
can not. The consequence is that we have to split the packets if we want
to feed them to the lavc codec.

This is not entirely correct yet: timestamp handling is missing.
--demuxer=lavf and ffmpeg native utilities have the same problem. We can
fix this only once the ffmpeg VP9 parser is fixed.
terminal: always use SA_RESTART with sigaction()

One problem is that for example stdio functions won't restart syscalls
manually, and instead treat EINTR as an error. So passing SA_RESTART is
the only sane thing to do, unless you have special requirements, which
we don't.
build: conditionally use -Wempty-body

-Wempty-body is not available on all gcc versions but we were using it
unconditionally. Also remove the usage from the clang case. clang still
defines `__GNUC__` so it still gets all the gcc specific flags.

This should fix the build on systems with older gcc versions like OpenBSD which
still comes bundled with gcc 4.2 for license issues.
build: use -pthread when available

Our code currently tries to link -lpthread and adds stuff like -D_REENTRANT
based on the target platform.

GCC actually supports to just pass a -pthread compiler and linker flag that
will automatically enable threading and define the correct symbols for the
platform, so let's try to just use that as our first choice.

clang also supports -pthread but it must be used only as a compiler flag,
so we also take care of that scenario with this commit.
TOOLS: move autocrop.lua to TOOLS/lua
in anticipation of more lua scripts
TOOLS: add lua/drc-control
allows live insertion/deletion/adjustment of drc audio filter
TOOLS: indent lua scripts by 4 spaces instead of 3
vf_vapoursynth: keep pixel aspect ratio

Make the filter apply the pixel aspect ratio of the input to the output.
This is more useful than forcing 1:1 PAR when playing anamorphic video
such as DVDs.

VapourSynth itself actually allows passing through the aspect ratio, but
it's in a not very useful form for us: it's per video-frame instead of
constant (i.e in VSVideoInfo). As long as we don't have a way to allow a
filter to spontaneously change output parameters, we can't use this.
(And I don't really feel like making this possible.)
vf_vapoursynth: use official AbsoluteTime property

I thought the "_" in "_AbsoluteTime" was part of the documentation
markup.

This still doesn't help us with VS filters that change timing;
apparently you must use frame durations instead.
client API: add chapter change event

Also works for mpv_observe_property() on the "chapter" property.
man: grammar tweak of mp.add_timeout()
vf-metadata: fix handling of NULL metadata

lavfi would segfault due to a NULL dereference if it was asked for its
metadata and none had been allocated (oops). This happens for libav
which has no concept of filter metadata.
vf_lavfi: reset metadata in reset()

It might have been nice not to do this so that metadata could
accumulate accross seeks, but it seems libavfilter looses its copy
anyway on recreate_graph.
TOOLS: improve autocrop.lua

It now inserts no filters and does nothing until the hot-key is pressed.
This makes it more suitable to be put in ~/.mpv/lua.

When they hot-key is pressed, it now removes any existing crop filter and
inserts the cropdetect filter. It then samples the whole file to determine
crop parameters and uses them to insert the new crop filter. The cropdetect
filter is then removed and the original file position restored.