demux_lavf: get updated metadata from a packet if available

The side_data type is brand new in ffmpeg.
stream_lavf: prefix icy metadata with "icy-"

ICY metadata is not always of good quality, and especially if there are
proper tags. We don't want the ICY metadata override the tags.
demux: handle tag updates differently

Instead of printing lines like:

    Demuxer info GENRE changed to Alternative Rock

Just output all tags once they change. The assumption is that individual
tags rarely change, while all tags change in the common case.

This changes tag updates to use polling. This could be fixed later,
although the ICY stuff makes it a bit painful, so maybe it will remain
this way.

Also remove DEMUXER_CTRL_UPDATE_INFO. This was intended to check for tag
updates, but now we use a different approach.
demux_lavf: clear metadata on update, instead of merging it

Assume a metadata update is a full update. Clear the previous metadata,
so that tags which existed only in the previous metadata are removed.
demux: fill metadata directly, instead of using wrapper functions

Get rid of demux_info_add[_bstr] and demuxer_add_chapter_info.

Make demuxer_add_chapter_info return the chapter index for convenience.
demux: reword "Clip info:" line to "File tags:"
DOCS/crosscompile-mingw: update

MXE's ffmpeg is not old anymore.
DOCS/crosscompile-mingw: use Markdown
DOCS/waf-buildsystem: add link to the Waf book
demux_lavf: don't check for error when setting "keepside" flag

This flag doesn't exist on Libav (because they never do this insane
packet merging stuff), so this would print unnecessary warnings there.
demux_lavf: do metadata-from-packet update before possibly discarding it

There is some logic to discard packets from streams that are not
selected. Run the metadata update code before this, just to make 100%
sure that no metadata updates can be lost when streams are deselected.

(I'm not sure why this logic would be needed, since both libavformat and
the generic demuxer code do this already. But a quick test shows that
av_read_frame() can return a packet from a stream even if the stream has
AVStream.discard set to AVDISCARD_ALL. This happened after stream
switching. Maybe libavformat doesn't discard already queued packets.)
gl_x11: always request true color visual

This fixes issue #504. For some reason, glXChooseFBConfig() will return
a fbconfig with no associated visual. (I'm not sure if this allowed.
They don't always have a visual, but since GLX_X_RENDERABLE is set
and GLX_DRAWABLE_TYPE is (implicitly) set to GLX_WINDOW_BIT, why would
there be no visual?)

Even worse, a test program seems to show that a 16 bit fbconfig is
selected (instead of 24/32 bit), which doesn't sound nice at all. Since
there _are_ better fbconfigs available, glXChooseFBConfig() should
normally sort them by quality, and return the better ones first. It's
worth noting that this function should also prefer GLX_TRUE_COLOR
over anything else, although this comes last in the sort order.

Whatever is going on, requesting GLX_X_VISUAL_TYPE with GLX_TRUE_COLOR
seems to fix it.
gl_x11: don't require a X visual for modern GL context creation

Legacy GL context creation (glXCreateContext) explicitly requires a X
visual, while the modern one (glXCreateContextAttribsARB) does not for
some reason. So fail only on the legacy code path if we don't find a
visual. Note that vo_x11_config_vo_window() will select a default visual
if a NULL visual is passed to it.
player: handle seek delays differently

The code removed from handle_input_and_seek_coalesce() did two things:

1. If there's a queued seek, stop accepting non-seek commands, and delay
   them to the next playloop iteration.
2. If a seek is executing (i.e. the seek was unqueued, and now it's
   trying to decode and display the first video frame), stop accepting
   seek commands (and in fact all commands that were queued after the
   first seek command). This logic is disabled if seeking started longer
   than 300ms ago. (To avoid starvation.)

I'm not sure why 1. would be needed. It's still possible that a command
immediately executed after a seek command sees a "seeking in progress"
state, because it affects queued seeks only, and not seeks in progress.
Drop this code, since it can easily lead to input starvation, and I'm
not aware of any disadvantages.

The logic in 2. is good to make seeking behave much better, as it
guarantees that the video display is updated frequently. Keep the core
idea, but implement it differently. Now this logic is applied to seeks
only. Commands after the seek can execute freely, and like with 1., I
don't see a reason why they couldn't. However, in some cases, seeks are
supposed to be executed instantly, so queue_seek() needs an additional
parameter to signal the need for immediate update.

One nice thing is that commands like sub_seek automatically profit from
the seek delay logic. On the other hand, hitting chapter seek multiple
times still does not update the video on chapter boundaries (as it
should be).

Note that the main goal of this commit is actually simplification of the
input processing logic and to allow all commands to be executed
immediately.
demux_lavf: work around idiotic libavutil API printing a warning

Trying to set a non-existent flag (like +keepside on Libav) causes
libavutil print an incomprehensible warning (something about eval;
probably the overengineered libavutil option parser tripping over the
'+' normally used for flags, and trying to interpret it as formula).

There's apparently no easy way to check for the existence of a flag,
so add some more ifdeffery to shut it up.
msg: clear lines by printing spaces on MS Windows

On Windows, no ANSI control sequences are available, so we can't easily
clear lines, move the cursor, etc. It's yet to be decided how this
should be handled (emulate ANSI escapes in osdep/terminal-win.c, or
provide abstracted terminal API functions to unify the Linux and Windows
code).

For now, this fixes the regression that was introduced earlier by the
status line rewrite. It doesn't fix all aspects of status line and
terminal OSD handling, as can be clearly seen by the unconditional use
of terminal_erase_to_end_of_line further down the changed code.

Fixes github issue #499 (sort of).
vo_opengl: use exactly the values defined by BT.709 for CMS

I could not see any difference whatsoever, but for usage with a 3DLUT
there's zero performance difference so we might as well follow the spec to
the letter.
player: fix an assert when reinitializing audio in some cases

This sometimes happened when changing playback speed (= reinitializing
audio) after seeking of playback start. The assertion in audio.c:441 was
triggered, because buffer_playable_samples wasn't reset correctly when
the audio buffer was cleared or shortened. The assertion is correct and
should hold up any time.
demux: fix some newlines in output messages
demux_mkv: improve audio-only seeking

v_skip_to_keyframe is set to true while non-keyframe video packets are
skipped. Until now, audio packets were also skipped when doing this. I
can't see any good reason why this would be done, but for now I want to
keep the old logic when audio+video seeks are done.

However, for audio-only mode, do proper seeking, which also fixes
behavior when trying to seek past the end of the file: playback is
terminated properly, instead of starting playback on the start of the
last cluster.

Note that a_no_timecode_check is used only for audio+video seek. I'm
not sure what this is needed for, but it might influence A/V sync after
seeking.