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