vo_vdpau: fix preemption recovery after recent commits

Recent commits for screenshot support and video redraw changes didn't
handle vdpau driver preemption state correctly, which could make the
player crash if preemption occurred. Fix this and improve preemption
handling a bit otherwise.
configure, build: require at least Libav 0.7

Require versions of the Libav libraries corresponding to Libav release
0.7. These are:
libavutil   51.7.0
libavcodec  53.5.0
libavformat 53.2.0
libswscale   2.0.0
libpostproc 52.0.0

Also disable the fallback to simple header check if these libraries
could not be found with pkg-config; now compiling without pkg-config
support for these always requires explicitly setting --enable-libav
and any needed compiler/linker flags. The simple check would have let
compilation proceed even if a version mismatch was detected.
Libav API updates (remove most deprecated-in-0.7 uses)

Update various code using Libav libraries to remove use of API
features that were deprecated at Libav release 0.7. I think this
removes them all with the exception of URLContext functions still used
in stream_ffmpeg.c (at least other uses that generated deprecation
warnings with libraries from 0.7 are removed).
stream_ffmpeg: switch to libavformat avio API

stream_ffmpeg was using the libavformat URLContext API. This API has
been deprecated (for public use at least) in libavformat. Switch to
the AVIOContext API.
vf_fspp: make compile without Libav internals

Make vf_fspp compile without using internal Libav/FFmpeg files and
compile it by default.
ad_ffmpeg: pass packet side data from libavformat

Pass avpacket->side_data when using a libavcodec audio decoder
together with libavformat demuxer (this was already done for video).
cleanup: remove left over access_mpcontext.h (from GUI)

access_mpcontext.h and the declared functions in mplayer.c were only
used by the now deleted internal GUI. Remove the unused header and
functions.
osd: always display pause icon when frame stepping

When the OSD was enabled and the player was paused by executing the
frame_step command, the OSD still displayed the icon indicating
playback. Fix this and always set the proper icon when the pause
state is changed.
core: print pause status message only once on console

Since the recent OSD redraw changes, every GUI expose event causes the
message "=====  PAUSE  =====" to be printed on console. This was a bit
annoying, so change it so that it is only printed once when going into
paused mode. It's also printed again if the cache status changes (when
playing URLs), or when the status line is printed during pause mode (when
you seek while paused).

This also removes some minor code duplication.
af_volume: do not change data when volume is 1

When the volume multiplier is 1, the data shouldn't be changed, but the
code actually multiplied each sample with 255/256. Change the factor to
256, and hope there wasn't a good reason for the value 255.

Additionally, don't work on the data if it wouldn't be changed anyway.
This is a micro-optimization.

This doesn't touch the code path for the float format.
audio: change default preference order of AO drivers

Now PulseAudio is preferred over ALSA, which in turn is preferred over
OSS. This should give best results on all systems. On systems with
PulseAudio, we will always use it natively, rather than through the
suboptimal ALSA emulation (which the default ALSA output is normally
redirected to when PulseAudio is active; ALSA hardware devices will
not be, but to use those the user must set AO explicitly in any case,
so changing the defaults makes no difference). The fallback from
ao_pulse to ao_alsa causes no noticeable delay on systems without
PulseAudio. On systems with ALSA, we won't attempt to use OSS anymore.

Also, move OpenAL above SDL. OpenAL should generally work better than
SDL.
stream_vcd: fix option value allocated with strdup

A string freed with m_struct_free() was allocated with strdup(). This
would cause a crash when using vcd:// streams. Fix to use
talloc_strdup().
vd_ffmpeg: explicitly set thread count even if 1

Libav started automatically enabling threaded decoding a while ago.
This is not safe, as it means callbacks can suddenly get called from
other threads and outside calls to libavcodec. We need to know when
threading will be used and disable thread-unsafe callbacks in those
cases. Explicitly set thread count to 1 instead of leaving it at 0
(which triggers the autodetection) when we are not requesting more
threads; this should make sure that autodetection on libavcodec side
will not be used.
Update copyright year
Update Libav API uses

Change various code to use the latest Libav API. The libavcodec
error_recognition setting has been removed and replaced with different
semantics. I removed the "--lavdopts=er=<value>" option accordingly,
as I don't think it's widely enough used to be worth attempting to
emulate the old option semantics using the new API. A new option with
the new semantics can be added later if needed.

Libav dropped APIs that were necessary with all Libav versions
until quite recently (like setting avctx->age), and it would thus not
be possible to keep compatibility with previous Libav versions without
adding workarounds. The new APIs also had some bugs/limitations in the
recent Libav release 0.8, and it would not work fully (at least some
avcodec options would not be set correctly). Because of those issues,
this commit makes no attempt to maintain compatibility with anything
but the latest Libav git head. Hopefully the required fixes and
improvements will be included in a following Libav point release.
demux_lavf: use Libav RIFF tag lists directly

Change demux_lavf to use CodecID -> RIFF tag mappings that are now
available through the public Libav API. Previously it used a copy in
ffmpeg_files/taglists.c. That can now be deleted.
build: switch to libavutil bswap.h and intreadwrite.h

Remove the private bswap and intreadwrite.h implementations and use
libavutil headers instead.

Originally these headers weren't publicly installed by libavutil at
all. That already changed in 2010, but the pure C bswap version in
installed headers was very inefficient. That was recently (2011-12)
improved and now using the public bswap version probably shouldn't
cause noticeable performance problems, at least if using a new enough
compiler.
vd_ffmpeg: adjust buffered frame count based on threads again

Libav has changed back to not modifying avctx->has_b_frames based on
the extra buffering caused by thread use. Add back the code to do the
adjustment on the player side once again.

The timing mode using the buffering info is no longer the default, so
in most cases having this right or not won't matter for playback.
vd_ffmpeg: fix flushing of buffered frames

The vd_ffmpeg decode() function returned without doing anything if the
input packet had size 0. This meant that flushing buffered frames at
EOF did not work. Remove this test. Have the core code skip such
packets coming from the file being played instead (Libav treats
0-sized packets as flush signals anyway, so better assume such packets
do not represent real frames with any codec).
screenshot: fix libav API use (pix_fmt and some other things)

Libavcodec started checking that avctx->pix_fmt is set when opening
an encoder. The existing code (originally from vf_screenshot.c) only
set it afterwards, which now made screenshots fail. Fix the code to
set parameters before calling avcodec_open2().

Also fix some minor things, which seems to make it work for other
encoders. This could be used to add more libavcodec based image
writers. Fix memory leak (missing av_free(avctx)).