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
cocoa_common: implement VOCTRL_UPDATE_WINDOW_TITLE

Unfortunately this backend creates the window lazily and a call to
`cocoa_set_window_title` is needed inside config.
vf_dlopen filters: add an "ildetect" filter that detects interlacing

The filter analyzes each frame for combing, and decides at the end
whether the content is likely interlaced, telecined or progressive.
encode_lavc strings: use new option syntax
vf_dlopen ildetect: make the wrapper shell script more robust
vf_dlopen ildetect: fix numdecidedadjacentframes counter
fix compile, sorry
ao_coreaudio: uncrustify

uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace \
  audio/out/ao_coreaudio.c
ao_coreaudio: move to new libao API

This is just a first pass and the bare minimum to make it compile and work.
SPDIF is untested for lack of hardware.
ao_coreaudio: split ringbuffer in it's own file

This is hopefully the start of something good. ca_ringbuffer_read and
ca_ringbuffer_write can probably cleaned up from all the NULL checks once
ao_coreaudio.c gets simplyfied.

Conflicts:
	audio/out/ao_coreaudio.c
ao_coreaudio: fix output with spdif

The mute condition was inverted...
core: add a spsc ringbuffer implementation

Currently every single AO was implementing it's own ringbuffer, many times
with slightly different semantics. This is an attempt to fix the problem.

I stole some good ideas from ao_portaudio's ringbuffer and went from there.
The main difference is this one stores wpos and rpos which are absolute
positions in an "infinite" buffer. To find the actual position for writing /
reading just apply modulo size.

The producer only modifies wpos while the consumer only modifies rpos. This
makes it pretty easy to reason about and make the operations thread safe by
using barriers (thread safety is guaranteed only in the Single-Producer/Single-
Consumer case).

Also adapted ao_coreaudio to use this ringbuffer.