cache2: uncrustify
stream: rename cache2.c to cache.c

I never found cache1.c (whatever it was named, if it ever existed).

cache2.h will be deleted later, so don't go through the trouble of
renaming it.
core: use STREAM_CTRL instead of accessing stream_dvd internals

Some code in mplayer.c did stuff like accessing (dvd_priv_t *)st->priv.
Do this indirectly by introducing STREAM_CTRL_GET_DVD_INFO. This is
extremely specific to DVD, so it's not worth abstracting this further.

This is a preparation for turning the cache into an actual stream, which
simply wraps the cached stream. There are other streams which are
accessed in the way DVD was, at least TV/radio/DVB. We assume these
can't be used with the cache. The code doesn't look thread-safe or fork
aware.
stream: misleading statement
stream_dvd: remove some deadly insane code

Of course all of stream_dvd.c (as well as libdvdread) is completely
insane, but at least this hack for ancient broken compilers on really
obscure platforms should be safe to remove.
stream_cdda, stream_vcd: check read buffer size

These assumed that the buffer provided with fill_buffer() was at least
sector sized, instead of checking the size parameter.

This is just a cleanup, since every caller made sure to align everything
on sector sizes, if a stream has the sector size set.
stream: move VCD specific stuff to stream_vcd

I don't even know what VCDs are. A prehistoric version of the DVD or so.
stream: remove unused function
stream: remove pointless check
image_writer: Add PNG filter option (default "mixed")

The use of filters prior to PNG compression can greatly improve
compression ratio, with "mixed" (ImageMagick calls it "adaptive")
typically achieving the best results.
gl_video: typo in comment
gl_video: fix scaling when image is cropped, or with no-npot

When the displayed image is cropped in Y direction (like using panscan
controls when playing 4:3 video on a 16:9 monitor), and separated
scaling is used, the texture size for the FBO holding the intermediate
result was calculated incorrectly. This could lead to artifacts, which
were quite apparent with extreme scale factors.

Actually, the size of that texture is OK, but the texture shouldn't be
used to hold the complete scaled image. Instead, it should be used for
the visible part of the image only. Because separate scaling works by
scaling in Y direction first, it's still fine to scale the image on the
full image width on the first pass. This helps avoiding artifacts on
the left/right border of the image when scaling in X direction, as the
scaler will try to fetch pixels from beyond the border. (The left border
is still kind of fine, but the right border will fetch garbage, unless
the texture is strictly sized, or explicit clamping is added to the
shader. Too much trouble, so using the full image width is simpler.)

Also fix some issues with no-npot mode, which enables use of power-of-2
textures. Maybe this mode isn't really useful anymore (modern hardware
is faster with smaller non-power-of-2 textures), but keep it for now.
gl_video: rearrange some code

I think this is slightly nicer. Shouldn't change anything functionally.
vo: redo video display rectangle calculations

This code calculates the source/display video rectangle for scaling with
most VOs. It's responsible for clipping the display rectangle against
the screen and adjusting the source rectangle accordingly.

Until now, it assumed that the video was centered on the screen. Change
this so that any rectangle is possible. Basically, the clipping is
extended to two sides (e.g. left and right), instead of handling both at
the same time.

The rounding behavior slightly changes. It seems to be slightly better
than before. On the other hand, the video is not strictly centered
anymore (due to different rounding on either side). When using panscan
controls, the video can "jitter" by 1 or 2 pixels around the center as
the panscan value is changed.
vo_xv: always request redraw on resize

Fixes using panscan controls with OSD off and video paused.
demux_lavf: show metadata for OGG audio files

Whether this is a hack or not, I don't even know anymore.
w32_common: fix non-sense

Seriously...
w32_common: remove some unneeded code

vo_w32_init() can be called only once on a VO.
vo: define VO_TRUE/FALSE to C99 constants

This make the intention more apparent, and some VOs are actually using
true instead of VO_TRUE in some places. Hopefully this changes makes it
less confusing (instead of more).

The C99 constants true/false are defined to 1/0 as well, so this commit
doesn't actually change anything.
video/out: introduce VOCTRL_UPDATE_WINDOW_TITLE

Instead of implicitly changing the window title on config(), do it as
part of the new VOCTRL.

At first I wanted to make all VOs use the VOCTRL argument directly, but
on a second thought it appears vo_get_window_title() is much more useful
for some (namely, if the window is created lazily on first config()).

Not all VOs are changed. Wayland and OSX have to follow.