client API: make sure youtube-dl is not used by default

Currently, --ytdl is off by default, but even if this is changed, never
enable it by default for the client API. It would be inappropriate to
start an intrusive external subprocess behind the host application's
back.
ao_alsa: minor fixes

Don't crash if no fallback channel layout could be found (caller can't
handle NULL return from select_chmap()). Apparently this could never
actually happen, though.

Don't treat snd_pcm_hw_params_set_periods_near() failure as fatal error.
Same deal as with snd_pcm_hw_params_set_buffer_time_near().

Actually free channel maps returned by snd_pcm_get_chmap().

Adjust some messages.
ao_alsa: select and set channel maps via channel map API

Use the ALSA channel map API for querying and selecting supported
channel maps.

Since we (probably?) want to be compatible with ALSA versions before the
change, we still try to select the device name by channel map, and open
that device. There's no way to negotiate a channel map before opening,
so we're stuck with this approach. Fortunately, it seems these devices
allow selecting and setting any other supported channel layout, so maybe
this is not an issue at all. In particular, this avoids selecting the
default (dmix) device, which can only do stereo.

Most code is based on Martin Herkt <lachs0r@srsfckn.biz>'s alsa_ng
branch, with heavy modifications.
ao_alsa: always enable "plug" plugin for non-default device

This seems safer: otherwise, opening the AO could randomly fail if the
audio formats happens to be not float.

Unfortunately, this only works if the user does not select a device.
Since ALSA devices are arbitrary strings, including plugins with complex
parameters, it's not trivial or maybe even impossible to edit the string
in a way the "plug" plugin is added.

With --audio-device, it would be safe for users to select either
"default" or one of the "plughw" devices. Everything else seems
questionable.
ao_alsa: fix channel map in pre-channel map API case

Forgotten in commit 5d5f5b09.
demux_lavf: set PTS of first packet for formats with no timestamps

Makes time display work for some raw audio formats (*.shn).
manpage: lua: fix typo paramater -> parameter
DOCS/crosscompile-mingw: update

Add `.static` for MXE targets.

Signed-off-by: wm4 <wm4@nowhere>
ytdl: When using DASH, print actual duration

prints the actual duration as reported by youtube-dl to the
terminal when available
ytdl: Try to handle multi-arc videos

this currently uses a sketchy but apparently working workaround,
which will be removed once the neccessary changes in youtube-dl
are implemented

Fixes #1277
ytdl: bump requrired youtube-dl version to 2014.11.26
vo_opengl: something

Insert explanation here.

Fixes #1023.
vo_opengl: fix srgb with certain inputs

Sampling from the source texture and scaling must always be done
separately in this mode.

Fix suggested by haasn.

Still looks a bit wrong, though.
vo_opengl: make operator precedence explicit

More readable.
vo_opengl: Reword comment in shader

I didn't quite understand this comment after looking at the code again
months later, so I reworded it for better clarity.
gl_common: factor context creation

Always create the context in mpgl_init(), instead of doing it when
mpgl_config_window() is called the first time. This is a small step
towards cleaning up the GL backend interface, and adding other things
like perhaps GLES support, or a callback-driven backend for libmpv.
Do not call strerror()

...because everything is terrible.

strerror() is not documented as having to be thread-safe by POSIX and
C11. (Which is pretty much bullshit, because both mandate threads and
some form of thread-local storage - so there's no excuse why
implementation couldn't implement this in a thread-safe way. Especially
with C11 this is ridiculous, because there is no way to use threads and
convert error numbers to strings at the same time!)

Since we heavily use threads now, we should avoid unsafe functions like
strerror().

strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and
gives the function different semantics than the POSIX one. It's a bit of
work to convince this piece of shit to expose the POSIX standard
function, and not the messed up GNU one.

strerror_l() is also in POSIX, but only since the 2008 standard, and
thus is not widespread.

The solution is using avlibc (libavutil, by its official name), which
handles the unportable details for us, mostly. We avoid some pain.
vo_opengl: Linearize non-RGB sRGB files correctly (eg. JPEG)

Signed-off-by: wm4 <wm4@nowhere>
mixer: don't show softvol neutral marker on OSD if not using softvol

Also fix the comment on the softvol field.
audio: fix busy loop when seeking while paused

When playing paused, the amount of decoded audio is limited to a small
amount (1 sample), because we don't write any audio to the AO when
paused. The small amount could trigger the case of the wanted audio
being too far in the future in the PTS sync code, which set the audio
status to STATUS_DRAINING, which in turn triggered the EOF code in the
next iteration. This was ok, but unfortunately, this triggered another
retry in order to check resuming from EOF by setting the status to
STATUS_SYNCING, which in turn lead to the busy loop by alternating
between the 2 states. So don't try resyncing while paused.

Since the PTS syncing code also calls ao_reset(), this could cause the
pulseaudio daemon to consume some CPU time as well.

This was caused by commit 33b57f55. Before that, the playloop was merely
run more often, but didn't cause any problems.

Fixes #1288.