audio: fix mid-stream audio reconfiguration

Commit 22b3f522 not only redid major aspects of audio decoding, but also
attempted to fix audio format change handling. Before that commit, data
that was already decoded but not yet filtered was thrown away on a
format change. After that commit, data was supposed to finish playing
before rebuilding filters and so on.

It was still buggy, though: the decoder buffer was initialized to the
new format too early, triggering an assertion failure. Move the reinit
call below filtering to fix this.

ad_mpg123.c needs to be adjusted so that it doesn't decode new data
before the format change is actually executed.

Add some more assertions to af_play() (audio filtering) to make sure
input data and configured format don't mismatch. This will also catch
filters which don't set the format on their output data correctly.

Regression due to planar_audio branch.
audio: use the decoder buffer's format, not sh_audio

When the decoder detects a format change, it overwrites the values
stored in sh_audio (this affects the members sample_format, samplerate,
channels). In the case when the old audio data still needs to be
played/filtered, the audio format as identified by sh_audio and the
format used for the decoder buffer can mismatch. In particular, they
will mismatch in the very unlikely but possible case the audio chain is
reinitialized while old data is draining during a format change.

Or in other words, sh_audio might contain the new format, while the
audio chain is still configured to use the old format.

Currently, the audio code (player/audio.c and init_audio_filters) access
sh_audio to get the current format. This is in theory incorrect for the
reasons mentioned above. Use the decoder buffer's format instead, which
should be correct at any point.
vo_vdpau: don't calculate destination alpha when drawing OSD

Same as MPlayer svn commit r36515 "Chose cheaper alpha blend equation."

No idea if this is actually faster, but can't hurt.
stream_dvb: remove bogus free calls

The priv struct is now allocated by talloc in stream.c. It doesn't need
to be manually freed, and using free() instead of talloc_free() probably
crashes.
player: simplify audio reset when seeking

Some decoders used to read packets and decode data when calling
resync_audio_stream(). This required a special case in mp_seek() for
audio. (A comment mentions liba52, which is long gone; but until
recently ad_mpg123.c actually exposed this behavior.)

No decoder does this anymore, and resync_audio_stream() works similar
as resync_video_stream(). Remove the special case.
af: cleanup documentation comments

And by "cleanup", I mean "remove". Actually, only remove the parts that
are redundant and doxygen noise. Move useful parts to the comment above
the function's implementation in the C source file.
audio/filter: remove unneeded AF_CONTROLs, convert to enum

The AF control commands used an elaborate and unnecessary organization
for the command constants. Get rid of all that and convert the
definitions to a simple enum. Also remove the control commands that
were not really needed, because they were not used outside of the
filters that implemented them.
audio: drop buffered filter data when seeking

This could lead to (barely) audible artifacts with --af=scaletempo and
modified playback speed.
demux: rename demux_packet.h to packet.h

This always bothered me.
audio/filter: rename af_tools.c to tools.c

This always bothered me.
ao_null: fix simulated buffer size

The size accidentally defaulted to 200 seconds instead of 200
milliseconds, which had fatal consequences when trying to use it.
vdpau_old: enable OpenGL interop

OpenGL interop was essentially disabled, because the decoder didn't
request vdpau device creation from vo_opengl.
player: deselect video track if initialization fails

This didn't have any consequences, other than suddenly reinitializing
video when it works again (such as with EDL timeline mixing video and
audio-only files).
player: select fallback stream in timeline code for better EDL handling

The intention of the existing code was trying to match demuxer-reported
stream IDs, instead of using possibly arbitrary ordering of the frontend
track list. But EDL files can consist of quite different files, for
which trying to match the stream IDs doesn't always make sense.
manpage: fix typo in --video-align-y description
timeline: add new EDL format

Edit Decision Lists (EDL) allow combining parts from multiple source
files into one virtual file. MPlayer had an EDL format (which sucked),
which mplayer2 tried to improve with its own format (which sucked). As
logic demands, mpv introduces its very own format (which sucks).

The new format should actually be much simpler and easier to use, and
its implementation is simpler and smaller too.
timeline: add edl:// URIs

Questionable change from user perspective, but internally needed to
implement the next commit. Also useful for testing timeline stuff.
player: add --merge-files option
timeline: remove support for the mplayer2 EDL format

It was a bit too complicated and inconvenient, and I doubt anyone
actively used it. The mpv EDL format should cover all use cases.
mplayer: fix passing size_t as %d to printf()