player: don't reset buffering pausing state on seeks

This was added with commit 3cbd79b3, but it turns out this
unintentionally enables "real" pausing when seeking while buffering. It
was done for ensuring correct state of the "cache-buffering-state"
property, but it also turns out that this was unneeded (another variable
that is reset when seeking happens to take care of this).
video: try harder to decode cover art picture only once

For cover art, we pretend that the video stream is infinite, but also
stop decoding once we have an image on the VO (this seems advantageous
for the case when strange filters are inserted or the VO image gets
lost). Since a while ago, the video chain started decoding 2 images
though ("Non-monotonic video pts: 0.000000 <= 0.000000"), which is
annoying and wasteful.

Improve this by handling a certain corner case at initialization, which
will decode a second image while the first one is still stuck in the
filter chain. Also, just in case there are filters which buffer a lot,
also force EOF filtering (which means we tell the filters to flush
buffered frames).

CC: @mpv-player/stable
vf_lavfi: proper rounding for lavfi->mpv aspect ratio

Or so I think. Not like it matters anyway.
client API: rename --input-x11-keyboard to --input-vo-keyboard

Apparently we need this for Cocoa too. (The option was X11 specific in
the hope that only X11 would need this hack.)
manpage: improve --wid description

In particular, add a basic description of how Cocoa embedding works.
audio: add device selection & listing with --audio-device

Not sure how good of an idea this is.

This commit doesn't add support for this to any AO yet; the AO
implementations will follow later.
ao_alsa: implement device listing & selection

Unfortunately, ALSA is particularly bad with this, because mpv has to
add all sorts of magic crap to the device name to make things work. The
device selection overrides this, so explicitly selecting devices will
most likely break your audio. This has yet to be solved.
client API: add an explanatory comment

So someone reading this at least has a chance to find out what this is
needed for.
x11: fix inverted condition

Worryingly wrong. Fixes #1162.

Also fix another issue (window title was set anyway), which was why I
didn't notice this and testing it seemed to be fine.
manpage: fix --audio-pitch-correction description

Add closing ">" and specify what is the default value.
libmpv/cocoa: make global events work and get rid of is_cplayer

After @frau's split of macosx_events from macosx_application, `is_cplayer' is
not needed anymore. At the moment only global events such as Media Keys and
Apple Remote work, because the VO-level ones were hardcoded to be disabled.
(that will be fix in a later commit ).
cocoa: fix 'uninitalized' access

I think this doesn't make a difference, since in Objective-C nil responds as
a NullObject, but better not depend on this crappy language feature.
libmpv/cocoa: don't start the event monitor

The event monitor is used to get keyboard events when there is no window, but
since it is a global monitor to the current process, we don't want it in a
library setting.
fix -Wduplicate-decl-specifier warnings with clang
cocoa: post keydown and keyup events without event monitor

Our code worked under the assumption that the event monitor is always active
and we did remove the keydown and keyup overrides from our cocoa view.
fix -Wvisibility warnings with clang

Now everything compiles with no warnings! yay!
audio/out/push: fix EOF heuristic

Since the internal AO driver API has no proper way to determine EOF, we
need to guess by querying get_delay. But some AOs (e.g. ao_pulse with
no-latency-hacks set) may never reach 0, maybe because they naively add
the latency to the buffer level. In this case our heuristic can break.

Fix by always using the delay to estimate the EOF time. It's not even
that important - it's mostly used to avoid blocking draining. So this
should be ok.

CC: @mpv-player/stable (maybe)
audio/out/push: make draining slightly more robust

Don't wait after the audio thread has pushed the remaining audio to the
AO. Avoids hard hangs if the heuristic fails completely (could still
happen if get_delay returns absurd values).

CC: @mpv-player/stable
Add some missing "const"s

The one in msg.c was mistakenly removed with commit e99a37f6.

I didn't actually test the change in ao_sndio.c (but obviously "ap"
shouldn't be static).
Revert "player: --save-position-on-quit should always work"

This reverts commit 45c8b97efbaff7a5031b008223eeed56f7b0607a.

Some else complained (github issue #1163).

The feature requested in #1148 will be implemented differently in
the following commit.