vo_gl3: call glFlush() after frame drawing is complete

Call glFlush() after a frame has been drawn and we're going to only
wait for the correct time before flipping it.

Helps a little bit with stuttering with pans and "heavy" subtitles
covering the screen.
input: fix possible crash in printing key combo names

The code didn't update a pointer when address could change after
reallocation. Probably rarely happened in practice.
demux_viv: fix unsafe code

Looks like the strtok() could have continued beyond allocated memory.
subreader: fix unsafe sscanf calls with "%["

"%[,.:]" conversion was used with a buffer that could be shorter than
the matched string. Suppress assignment of the conversion since the
value wasn't used anyway, and also limit match length to 1 as it
doesn't look like the intent was to match longer runs of the
characters.
subassconvert: do not escape likely ASS override tags

Some Windows players implement rendering of SubRip files by converting
to ASS format, but fail to escape text that could be considered ASS
markup. Unfortunately, this had led to the creation of files which mix
SubRip and ASS markup, relying on rendering being implemented this way
and on the ASS markup falling through to the ASS renderer unescaped.

Add a simple heuristic to detect whether '{' is likely to start an ASS
tag: if the string starts with '{\', and there is a closing '}',
assume it's an ASS tag and pass it through unescaped, otherwise escape
the '{' properly.

Thus tags like "{\a6}" are interpreted as ASS markup, while most
legitimate uses of '{' and '}' should work fine. We assume that nobody
uses {...} for commenting text in SubRip files. (This kind of comment
is popular and legal in ASS files, though.)
osd: convert OSD font to OpenType

The old OSD font was a PostScript Type 1 font. Convert it to OpenType
to work around a bug in latest fontconfig [1]. OpenType is a more
modern format, and the font file is quite a bit smaller, so this is
actually a nice change.

The conversion was done by opening the font with fontforge and saving
it as OpenType (CFF). fontforge showed a warning when doing this:

    The font contains errors.
      Self Intersecting
      Bad Private Dictionary

These seem to be harmless.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=63922
ad_libav: flush decoder output after last input packet

Some versions of libav APE audio decoder can consume a packet and
return data on subsequent calls. This could lead to audio being cut at
end of file as mplayer2 stopped decoding as soon as input as
exhausted. Keep calling libavcodec audio decoder until it returns no
more output.
audio: add af_lavrresample, remove old resampling filters

Remove `af_resample` and `af_lavcresample`. The former is a mess while
the latter uses an API that was long deprecated in libavcodec and is
now removed. Add new filter af_lavrresample which uses libavresample.
`af_lavrresample` has roughly the same features and structure as
`af_lavcresample` had.

Libavresample is now a mandatory dependency. Change configure script
accordingly and remove #ifdefs in other code.
vo_gl3: add option "ibt709" for using the inverse BT.709 transfer curve