cocoa: set and clear gl context inside of sync sections

The code did not set and unset the current context inside sync sections. I am
not sure if this was an actual problem but this is better since the context is
linked to a single thread. In my brief tests this seems to avoid garbage to
show up in fullscreen.
mplayer: don't call libquvi for local files

This is obviously not needed, and just creates potential for bad
breakages (e.g. what happens if libquvi tries to open a normal filename
as http URL?).

Note that for simplicity, we still pass file:// URIs to quvi, and we
don't exclude other protocol prefixes either. In general, we don't know
what protocols quvi might support, so we don't try to second-guess it.
(Even though in practice, it's probably only "http" and "https".)
ao_pcm: big endian AC3 in wav doesn't work

At least not with ffmpeg.

Honestly, I have no idea how little endian AC3 works at all, since
ao_pcm doesn't do anything special about it, and treats it like s16le.
Maybe it's broken and ffmpeg has special logic to detect it.
gl_video: add RGB10_A2 FBO format

Maybe this can be the default in the future, but I'm not sure yet.
cocoa: fix race condition with input context creation

This seems to be a problem only in OS X 10.9. I guess they improved the
general speed of the Cocoa startup and suddenly mpv core takes more time
than the Cocoa thread to initialize.

Fixes #285

(hopefully!)
cocoa: fix opening quarantined files on 10.9 with the bundle

It looks like on Mavericks the Finder is passing different arguments to mpv
depending on whether the opened file is quarantined or not.

Fixes #285
cocoa: fix opening quarantined files on 10.9 with the bundle [2]

Fixup commit for bbc146927
wayland: fix fullscreen transparent border regions

The default behavior of weston changed some time ago to not fill the surface
black for fullscreen windows.

Now let mpv draw the whole screen in fullscreen mode.
mplayer: make --length relative to actual start of file, instead of 0

We always use the file's timestamps, so the start time can be easily
something different from 0. Make the --length option respect this.
cocoa: constraint the window position a little more

The intention of this is to not make the window go outside the screen when
changing dimensions from 2x to .5x.
x11_common: reduce screensaver heartbeat from 30 to 10 seconds

Apparently this fixes issues with Gnome, which has a smaller timeout.
See github issue #315.
manpage: clarify --heartbeat-interval operation
README: add a link to the wiki about the FFmpeg vs. Libav issue
ao_alsa: don't include alloca.h

It's true that ALSA uses alloca() in some of its API functions, but
since this is hidden behind macros in the ALSA headers, we have no
reason to include alloca.h ourselves.

Might help with portability (FreeBSD).
osc: make sure the OSC actually fits into the video
mpvcore: add a note about desync on track switches
gl_common: suggest --vo=opengl-old if OpenGL 2.1 missing

If the caller requests at least OpenGL 2.1 (which --vo=opengl does),
but we get OpenGL 1.x, suggest using opengl-old.

Based on a patch by pfor on IRC.
vo_xv: check whether image allocation succeeds
x11: fix border toggling

Trying to toggle the border during fullscreen (with "cycle border")
would leave the window stuck without border, and it couldn't be
restored. This was because vo_x11_decoration() always excepted to be
called when toggling the state, and thus confusing the contents of the
olddecor variable. Add got_motif_hints to hopefully prevent this.

Also, when changing the border, don't take fs in account. May break on
older/broken WMs, but all in all is in fact more robust and simpler,
because you do not need to update the border state manually when
returning from fullscreen.
cocoa: apply the more invasive constraining only with cmd+1/2/3

Regression from bc49957
Fixes #321