video: wake up core as soon as possible

There's no reason to let the core wait until the frame is done
displaying. In practice, the core normally didn't need this additional
wakeup, and the VO was quick enough to fetch the new frame, before the
core even attempted to queue a new frame. But it wasn't entirely clean,
and the correct wakeup handling might matter in some cases.
TOOLS/mpv_identify.sh: simplify line-by-line reading

Use here-document idiom to read mpv output line-by-line.
TOOLS: eliminate echoes with variable substitutions

echo behaviour with backslash escapes seems to be non-portable: dash does
expand such an escapes and bash does not, so use cat/printf instead.
ao_oss: move code around

More logical, and preparation for the next commit. No functional
changes.
ao_oss: prevent hang when unpausing after device was lost

Pausing/unpausing while the audio device can't be reopened, and then
unpausing again when the device is finally reopened, can hang the
player for a while.

This happens because p->prepause_samples grows without bounds each
time the player is unpaused while the device is lost. On unpause,
ao_oss plays prepause_samples of silence to compensate for A/V timing
issues due to the partially lost buffer (we can't pause the device at
an arbitrary sample position, and the current period will be lost).
This in turn will make the player appear to be frozen if too much
audio is queued. (Normally, play() must never block, but here it
happens because more data is written than get_space() reports. A
better implementation would never let prepause_samples grow larger
than the period size.)

The unbounded growth happens because get_space() always returns that
the device can be written while the device is lost. So limit it to
200ms. (A better implementation would limit it to the period size.)

Also see #1080.
TOOLS/idet.sh: Handle the case of multiple Parsed_idet_0: output lines.

This seems to happen frequently now. It is handled by adding their values.
command: add osd-sym-cc property

This allows you to reproduce the OSD symbol.
command: allow using ASS tags on OSD messages

We don't allow this by default, because it would be silly if random
external data (like filenames or file tags) could accidentally trigger
them.

Add a property that magically disables this ASS tag escaping.

Note that malicious input could still disable ASS tag escaping by
itself. This would be annoying but harmless.
player: allow overriding OSD message for all OSD levels

Until now, you could override only level 3 with --osd-status-msg. Extend
this, add add --osd-msg1 to --osd-msg3 (one for each OSD level). OSD
level 0 always means disable OSD, so that isn't included.

--osd-msg3 corresponds to --osd-status-msg, but they're not exactly the
same. To allow more customization, --osd-msgN do not include the OSD
symbol. The symbol can be manually added with "${osd-sym-cc}". We keep
the "old" option for some short-term compatibility.

--osd-msg1 should be particularly useful; for example you could do:

    --osd-msg1='${?pause==yes:${osd-sym-cc}}'

to display a "paused" symbol when paused, and nothing during normal
playback. (Although admittedly, the syntax is quite a bit of work.)
video: filter new frames at a better time

Move this code below the code that "shifts" the newly filtered frame.
This allows us to skip a useless playloop iteration later, because
obviously we need to filter a new frame after the previous frame has
been "shifted", and not before that.
video: check whether there are enough frames after filtering

Move the check to a function. Run the check a second time after
decoding/filtering. This second check is strictly speaking redundant
(which is why it wasn't done until now), but it avoids a useless
playloop iteration.
video: separate calling decoder/filter

Rename video_decode_and_filter to video_filter, and add a new
video_decode_and_filter function. This function now calls the decoder.
This is done so that we can check filters a second time after decoding,
which avoids a useless playloop iteration.

(This and the previous commits are really just microoptimizations, which
simply reduce the number of times the playloop has to recheck
everything.)
video/filter: allow better dataflow

Consider a filter which turns 1 frame into 2 frames (such as an
deinterlacer). Until now, we forced filters to produce all output frames
at once. This was done for simplicity.

Change the filter API such that a filter can produce frames
incrementally.
vf_lavfi: fetch output frames incrementally

Uses the new mechanism introduced in the previous commit.

Depending on the actual filter, this distributes CPU load more evenly
over time, although it probably doesn't matter.
input: add function for setting repeat info

Let us set a different rate and delay.

Needed for the following commit where we set rate and delay reported by weston.
But only if the option native-keyrepeat is set.
wayland: use reported rete and delay

If native-keyrepeat is true then we set the rate and delay reported by the
compositor.
build: update minimum wayland version

Uh oh.
input: add locking for repeat info
af_hrtf: initialize coefficient arrays

Sometimes, --af=hrtf produces heavy artifacts or silence. It's possible
that this commit fixes these issues. My theory is that usually, the
uninitialized coefficients quickly converge to sane values as more audio
is filtered, which would explain why there are often artifacts on init,
with normal playback after that. It's also possible that sometimes, the
uninitialized values were NaN or inf, so that the artifacts (or silence)
would never go away.

Fix this by initializing the coefficients to 0. I'm not sure if this is
correct, but certainly better than before.

See issue #1104.
player: reset last_av_difference if not applicable

Don't let stale values linger around.

Also fix a slightly related case in audio.c.