configure: fix build with stable wayland releases
stream: read at least a full buffer with stream_peek()

Until now, stream_peek() read only the bare minimum it had to read from
the stream. But this could cause problems, such as being very
inefficient when peeking a lot, or conflicting with ability to seek
back. (The latter issue can be caused by peeking a few bytes, and then
doing a stream_read() with a size that is 1 byte longer: this would read
the peeked data, then call stream_fill_buffer(), which throws away the
previously peeked bytes - so you can't seek back anymore. This is
mitigated by a hack in demux_open(): it peeks a full buffer, to avoid
that peeking/reading during demuxer probing [or before that, in a stream
filter] can cause the buffer to be dropped.)
demux_playlist: port ini reference playlist parser

Port it from playlist_parser.c to demux_playlist.c. Also, change the m3u
parser to drop whitespace from the trailing part of the line (will make
it work properly with windows line endings).

(I hoped that this would make MMS URIs with http instead of mmsh
prefixes work, but it doesn't. Instead, it leads to a playlist loop. So
solving this issue would require a change in ffmpeg, probably.)
gl_video: don't crash if no FBOs are available

This probably has been broken since bbc865a: a test was added that uses
a FBO, but it's always run, even if FBOs were not detected. On the other
hand, fbotex_init() just runs into an assert. Fix the test that
triggered this condition, and make fbotex_init() "nicer" by just failing
if FBOs are not available.
input: fix --no-input-default-bindings

The option did nothing. This was probably broken with 5b38a52.
cocoa: let the core handle key repeats

Report key down and key up modifiers to the core so that it can issue it's
own key repeats (instead of relying on Cocoa's ones).
configure: fix some descriptions in the help output
video: add unscaled mode with --video-unscaled
change application icon

I would like to thank Chris Ward (@tenzerothree, http://tenzerothree.com/) for
working on the art for these icons and bringing some eye candy to the project.

The PSDs made by Chris are available on our Dropbox [1], along with the exports
I made to create OSX and Windows icons. The PSDs are almost completly vector
and all the resolutions look really similar, except the 16px favicon which was
handcrafted to look better and more recognizeable on the smaller pixel budget.

For Mac OS X the icons were created using iconutils on the PNGs iconsets
exported from the PSDs. These even support retina resolutions (except 512@2x).

For Windows the .ico file was created with imagemagick. The included images
are 16px, 24px, 32px, 48px 64px, 256px. These are the resolutions listed on
MSDN for supporting Windows XP [2] and Windows versions based on Aero [3].
Only 32bit PNGs were used since it is 2013.

For Linux nothing changed yet, even though @wm4 talked about using the PNGs
directly there. This will probably be dealt with in a later commit.

  [1]: https://www.dropbox.com/sh/yelfoj9tbft7o06/A8vOT6JKaG
  [2]: http://msdn.microsoft.com/en-us/library/ms997636.aspx
  [3]: http://msdn.microsoft.com/en-us/library/aa511280.aspx
cocoa_common: track mouse move events when not focused

This is really only important with the OSC and makes the tracking code behave
more consistently with the X11 one.
cocoa_common: enable click-through on the video view

Generate a mouse down event on the first click so that one can interact
with the OSC directly as opposed to wasting the first click in order to focus
the window.
input: lock for accessing struct input_ctx

The previous code was locking only the input queue. That was too weak since it
didn't protect the input_ctx data structure. So remove the locking on the queue
and lock all the public functions that interact with the input_ctx.

The private functions and public functions that do not act on the input_ctx
(there are quite some functions doing mp_cmd manipulations for instance) are
not locked.

Some changes by wm4. Use a recursive mutex, and restructure some code to be
less annoying with locks, such as converting code to single return, or
making use of the recursive mutex.
travis: don't generate docs for ffmpeg/libav

Fixes some breakage with ffmpeg-git
input: comment all default bindings in input.conf

I suspect most users will just copy etc/input.conf when they want to
remap some default bindings. But usually this means the user even copies
bindings he doesn't care about, and it's better if the user maps only
the bindings in his input.conf the user intends to remap.

Comment all bindings in etc/input.conf. Since this file also defines the
builtin defaults and is baked into the mpv binary, we have to do
something to get them anyway, even though they are commented. Do this by
having input.c "uncomment" the bindings in the baked in input.conf. (Of
course this is done only for the builtin config, not configs loaded from
disk.)
audio: fix playback of Musepack SV8 files

This is basically a libavcodec API oddity: it can happen that
avcodec_decode_audio4() returns 0 (meaning 0 bytes were consumed). It
requires you to feed the complete packet again to decode the full
packet, and to successfully decode the following packets.

We ignored this case with the argument that there's the danger of an
endless decode loop (because nothing of that packet is apparently
decoded, so it would retry forever), but change it in order to decode
mpc8 files correctly.

Also add some comments to explain the mess.
keycodes: cosmetics: align indentation
input: add some more X11 multimedia/internet keys

These keys can be found on various "multimedia" and "internet" keyboard.
X defines many keycodes, so I'm not adding all, just what I found on my
own keyboard.

Other key codes can be added on request.
input: stay in current input section if mouse button is down

Normally, moving the mouse outside of the mouse area of an input section
will send mouse events somewhere else (because input section mouse areas
are similar to windows/widgets in real GUI toolkits). This was done even
if a mouse button was held down. This is quite different from how GUI
toolkits behave.

Change the code so that if a mouse button is down, the mouse area of the
current input section can't be left. Releasing the mouse button (while
the mouse pointer is outside of the mouse area) will actually leave the
mouse area.

As a side-effect, this commit also tests more often whether the current
mouse input section is valid. This is needed to make releasing a mouse
button trigger the mouse input section change.
input: print more debug infos, raise loglevel
input: deal with spurious X11 LeaveNotify events

If the mpv window is unfocus, clicking on the OSC should focus the
window (done by the window manager) and allow interaction with the OSC.
But somehow X sends a spurious LeaveNotify event, immediately followed
by an EnterNotify event. This happens at least with IceWM. The result is
that the OSC will disappear (due to receiving MOUSE_LEAVE). The OSC will
stay invisible, because EnterNotify isn't handled, and there's nothing
that could make the OSC appear again.

Solve this by handling EnterNotify. We cause a redundant MOUSE_MOVE
event to be sent, which triggers the code to make the OSC visible. We
have to remove the code from input.c, which ignores redundant mouse move
events.

Since the code ignoring redundant mouse move events is still needed on
Windows, move that code to w32_common.c. The need for this is documented
in the code, also see commit 03fd2fe. (The original idea was to save
some code by having this code in the core, but now it turns out that
this didn't quite work out.)