demux_mkv: fix a hang with invalid files

ebml_read_length() could return a negative value (as uint64_t though)
at EOF, and this would then make ebml_read_skip() seek backwards. This
could lead to an infinite loop at EOF with corrupt files. Add an extra
check to make ebml_read_length() return EBML_UINT_INVALID instead if
EOF is hit in the middle of parsing.
vo_vdpau: fix off-by-one in rare error check

Probably doesn't matter much in practice.
input: fix "too many keys down" check

The check for too many simultaneously pressed keys had a off-by-one
error. Fix. This probably made no difference in practice as the limit
of 32 is so large that I doubt anyone would hit it.
subreader: jacosub: fix possibly writing one line too many

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35313 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix typo that might have caused reading beyond the string end.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35326 b3059339-0415-0410-9bf9-f77b7e298cf2
libav: use avcodec_free_frame() with new Libav

Latest Libav versions require that frame frame objects allocated with
avcodec_alloc_frame() must be freed with avcodec_free_frame(), instead
of the previously used av_free().
audio, libav: support planar Libav audio formats

Latest Libav versions have changed some decoders to support only
planar audio sample formats, which are not natively supported by
mplayer2 code. Add code (using libavresample) to convert libavcodec
decoder output to a supported format if needed. Add similar conversion
in the other direction to af_lavcac3enc (the ac3 encoder requires
planar input in latest Libav).

Libavresample support is optional and tested separately from the other
Libav libraries in configure. Libavresample is only included with the
latest Libav git versions. Older Libav versions do not include it, but
work fine without it, as older libavcodec does not use planar formats
and so does not require the conversion functionality.
mixer: fix lowering hw volume while muted

Lowering volume while muted did not work correctly with audio outputs
that support native mute setting separate from volume (ao_alsa and
ao_pulse), because the AO-level volume was not set while muted but was
still being read back. Fix by setting the AO volume in this case.
configure: fix --language=all

The configure code determining available manpage languages was missing
changes needed after moving the manpage to RST format. As a result,
trying to enable all languages created an invalid list of language
names, which led to a failure when trying to run "make install". Fix.
Note that currently the manpage is not available in the new format in
languages other than English, so trying to enable all languages
doesn't actually do anything different from the default.
configure: autodetect the binary name for rst2man

Upstream docutils installs rst2man under the name "rst2man.py". Some
distros change this to "rst2man", which is a saner name for a general
binary whose implementation language doesn't matter for its callers.
Previously manpage generation rules in Makefile assumed the "rst2man"
name. Support the "rst2man.py" name too by detecting the name to use
in configure.
TOOLS: add script for OSX bundle generation

Add a make task and shell script to create a Mac OS X Application
Bundle to be used when compiling with the --enable-macosx-finder and
--enable-macosx-bundle configure flags.
codecs.conf: add libavcodec h264_vda (OSX Video Decode Acceleration)

Add a codecs.conf entry to enable specifying the libavcodec h264_vda
decoder. Currently this decoder exists in libavcodec from FFmpeg only,
not Libav.

Video Decode Acceleration Framework is a framework by Apple to provide
GPU assisted H.264 decoding. It is available on Mac OS X v10.6.3 and
later with Mac models equipped with the NVIDIA GeForce 9400M, GeForce
320M, GeForce GT 330M, ATI HD Radeon GFX, Intel HD Graphics and
others.
cocoa_common: save state in the vo struct instead of globals

Save the cocoa state in an instance variable for the Objective-C part
of the code and use a field in the vo struct for the raw C part of the
code.
cocoa_common: use IOKit to perform power management

This allows to remove the call to the deprecated
`UpdateSystemActivity`. The additional benefit is power management is
disabled only if the video is really playing. A paused video will not
stop the system from idling.
cocoa_common: replace TickCount() with NSProcessInfo#systemUptime

TickCount is depracted in OS X 10.8. Substitute it with a public Cocoa
API call available since OS X 10.6.
cocoa_common: remove useless import

QuartzCore was probably forgot after extracting the code from
vo_corevideo. The OpenGL.h include can be avoided with no
warnings/errors.
gl_common: remove useless cocoa wrapper functions
cocoa_common: cosmetics / reformat

Use 80 columns almost exclusively and reformat Objective-C message
declarations to follow Apple's style (i.e.: - (int)name; instead of
- (int) name;).
cocoa_common: split window creation into helper functions

This commit hopefully makes it easier to follow the flow of the
program.
cocoa_common: use the same window level when windowed and fullscreen

This greatly simplifies the code and makes alt tab behave like it is
supposed to: it doesn't put the mplayer window behind the other ones
when losing focus.

If you have other programs that are displaying themselves above the
normal window level, avoid them or use --ontop.
cocoa_common: honor the --geometry option