Rename af_volnorm to af_drc

The previous name of this filter was misleading, because it doesn’t actually
normalize volume levels. What it does is closer to performing low-quality
dynamic range compression, hence it is now called af_drc.
demux: fix video with demux_mpg (DVD playback)

Commit 4d016a9 changed how demuxers report the codec of each stream.
Some of that was missed in video.c, which is important for legacy
demuxers (demux_mpg was broken by this, which is needed for DVD
playback).

Not sure about the ASF/AVI related change, but this is also a legacy
demuxers only codepath.
mp_common: silence warning

int64_t was accidentally used with "%lld" format specifiers, which is
incorrect (even though long long int is always 64 bits, the type behind
int64_t can be different, e.g. it can be long int on 64 bit platforms).
Prefix keycode defines with MP_

Do this to reduce conflicts with <linux/input.h>, which contains some
conflicting defines.

This changes the meaning of MP_KEY_DOWN:

  KEY_DOWN is renamed to MP_KEY_DOWN (cursor down key)
  MP_KEY_DOWN is renamed to MP_KEY_STATE_DOWN (modifier for key down state)
dec_video: fix bogus assert

Basically a typo. Made playing ordered chapters crash.
mplayer: fix seek display during seeking when playing ordered chapters

The seek bar appeared to be "stuck" to the start of the current chapter.
This is a regression from 630a2b1. This commit assumed that hrseek_pts
would always contain the hrseek target time (when hrseek_active==true).
But this is not always the case: when playing timeline stuff (e.g.
ordered chapters), hrseek framedropping is abused to handle an obscure
corner case, and then hrseek_pts contains something completely unrelated
to the current playback time. See the added comment in mplayer.c and
commit c1232c9.

Fix this by trying something else to get a correct time "during"
hr-seeks. mpctx->restart_playback looks ideal, because it's set while
audio is being synced / audio buffers being filled, so we know that the
audio time is probably bogus while it is set. Let's hope this is
correct.
Fix compilation with Libav
demux_mpg: fix setting codec

This made one case of DVD PCM audio not work. It still doesn't work,
but that will be fixed with the following two commits.
demux: restructure code that warns about packet buffer overflows

There should be no functional changes, except that way how avoiding
spamming the terminal with the overflow warning is handled changes a
bit.

The removed check for ds->eof looks suspicious, but it should be
redundant now.
demux: apply sparse video hack only to demux_lavf and demux_mkv

Apparently this cuases trouble for legacy demuxers. demux_mpg stopped
doing PCM audio. (The problem was probably that it read a bunch of
video packets on detection, and then the sparse video hack prevented
audio packets from being read, because it looked like there were no
more audio packets. With sparse video, this normally helps not reading
too many audio packets.)

Since the legacy demuxers do not need this hack, enable it for
demux_lavf and demux_mkv only.

Some additional hacks that were needed to handle legacy demuxers can be
removed, making the code simpler.

Also see commit 4a40eed.
vo_xv: fix green border on the right
osd: add --osd-bar-align-x/y options to control OSD bar position
wayland: add initial wayland support

All wayland only specific routines are placed in wayland_common.
This makes it easier to write other video outputs.

The EGL specific parts, as well as opengl context creation, are in gl_common.

This backend works for:
    * opengl-old
    * opengl
    * opengl-hq

To use it just specify the opengl backend
    --vo=opengl:backend=wayland
or disable the x11 build.

Don't forget to set EGL_PLATFORM to wayland.

Co-Author: Scott Moreau
(Sorry I lost the old commit history due to the file structure changes)
wayland: add vo backend description
wayland: clean up output_geometry

Remove useless members which weren't used at all.
Add empty switch for output transformations. At the moment I don't see any use
case for this.
wayland: change if statement
wayland: rename xinerama_info to screeninfo

Follows the changes made to vo_x11_update_screeninfo
wayland: remove some memory leaks

Also rearranges some stuff
wayland: change mouse timer interval

Shorter interval for hiding the mouse cursor in fullscreen mode.
wayland: use smaller interval while repeating keys

Use 2 Interval times one for pressing keys and then entering key
repeating and a second one if the same key is pressed longer.

This makes seeking faster with the arrow keys and doesn't repeat other keys
(e.g.: pausing or going fullscreen)