command: fix video-rotate update when paused

Due to the way video-rotate currently works, the state will be
automatically updated once new video is decoded. So the filter chain
doesn't need to be reinitialized automatically, but there is a need to
trigger the video instant refresh code path instead.

Also move the support function closer to an annoying similar yet
different function. They probably can be unified next time major changes
are done to this code.
command: make reverse cycle_values match up with forward one

The behavior of reverse cycling (with the "!reverse" magic value) was a
bit weird and acted with a "delay". This was because the command set the
value the _next_ command should use. Change this and make each command
invocation select and use the next command directly. This requires an
"uninitialized" special index in the counter, but that is no problem at
all.
osdep: NetBSD pthread_setname_np()

From: bugmen0t on github

Fixes #1207.
lua: don't let temporary values take the place of arguments

Because Lua is so terrible, it's easy to confuse temporary values pushed
to the Lua stack with arguments if the arguments are checked after that.

Add a hack that should fix this.
command: make trailing sub_add actually optional

This was always intended. Also fixes subtitle-file drag & drop.
player: show busy symbol on OSD if seeking takes too long

Same as it's done on the terminal.
audio/out: include coreaudio_exclusive in auto-probing

Move it above ao_null, so that it can be selected during auto-probing
(even if it's only last). I see no reason why it should not be included,
and it makes the following commit slightly more elegant. (See
explanations there.)
audio/out: don't add special devices to --audio-device list

Since the list associated with --audio-device is supposed to enable
simple user-selection, it doesn't make much sense to include overly
special things like ao_pcm or ao_null in the list. Specifically,
ao_pcm is harmful, because it will just dump all audio to a file
named audiodump.wav in the current working directory. The user can't
choose the filename (it can be customized, but not through this
option), and the working directory might be essentially random,
especially if this is used from a GUI.

Exclude "strange" entries. We reuse the fact that there's already a
simple list ordered by auto-probe priority in order to avoid having to
add an additional flag. This is also why coreaudio_exclusive was moved
above ao_null: ao_null ends auto-probing and marks the start of
"special" outputs, which don't show up on the device, but we want
coreaudio_exclusive to be selectable (I think).
audio/out: missing error check

Oops.
audio/out: add redirection-on-init mechanism

Looks like this will help us with making --audio-device and spdif work
as expected on OSX. To be used ina  following commit.
coreaudio: redirect IEC61937 to coreaudio_exclusive
reflect recent coreaudio changes in the manual
rename ao_coreaudio_device.c -> ao_coreaudio_exclusive.c

This is so that the source file name matches the AO name
win32: change config path priorities

Assume mpv.exe is located in $mpv_exe_dir, then config files were
preferably loaded from "$mpv_exe_dir/mpv". This was mostly traditional,
and inherited from MPlayer times.

Reverse the config path priority order, and prefer $CSIDL_APPDATA/mpv as
main config path. This also fixes behavior when writing watch_later
configs, and mpv is installed in a not-writable path.

It's possible that this will cause regressions for some users, if the
change in preference suddenly prefers stale config files (which may
happen to longer around in the appdata config dir) over the user's
proper config.

Also explicitly document the behavior.
manpage: ipc: comment about invalid UTF-8

Some rationale for the documented/suggested behavior:

It's not really clear what to do with invalid UTF-8, since JSON simply
can't transport this information. Maybe you could transfer such strings
as byte arrays, but that would be very verbose and inconvenient, and
would pose the problem that it's hard to distinguish between strings
encoded in this way and actual arrays.

There are many other ways how this could be handled. For example, you
could replace invalid sequences with '?'. Or you could do it like
Python, and use certain reserved unicode codepoints to "tunnel" through
invalid bytes.

Which of these works really depends on the application. And since this
can be done entirely on the byte level (invalid UTF-8 sequences can
appear only in strings in our case), it's best to leave this to the
receiver.
command: return error on invalid/absent IDs with ff-sid/ff-aid

Instead of just disabling the stream.

Also, check if the selected track has the right type, or we'd crash.
osc.lua: add “bottombar” and “topbar” layouts
command: add a "cached" mode to sub_add

This avoids reloading a subtitle if it was already added. In all cases,
the subtitle is selected.
osd: slightly change default style

Wider vertical margins, slightly thicker border and larger font
size should be an improvement.
command: print executed commands with -v