Catch SIGPIPE

Avoids a crash if OpenSSL tries to write to a broken connection with
write().

Obviously OpenSSL really should use send() with MSG_NOSIGNAL, but for
some reason it doesn't. This should probably be considered an OpenSSL
bug, but since in this case we "own" the process, there is no harm in
ignoring the signal.

This is not done with libmpv, because as a library we don't want to mess
with global state. It's also not done if terminal handling is disabled -
this is a bit arbitrary, but I don't care much.
demux_mkv: haali hack: add last frame duration to video length too

From what I can see, only the blockduration of the packet needs to be
added, never the "default duration".
command: add drop_buffers

This command was actually requested on IRC ages ago, but I forgot about
it.

The main purpose is that the decoding state can be reset without issuing
a seek, in particular in situations where you can't seek.

This restarts decoding from the middle of the packet stream; since it
discards the packet buffer intentionally, and the decoder will typically
not output "incomplete" frames until it has recovered, it can skip a
large amount of data.

It doesn't clear the byte stream cache - I'm not sure if it should.
command: dvd: better audio/video recovery on angle switching

Does the same thing as the drop_buffers command. When implementing that
command, it turned out that resetting the higher level playback state
was more effective for achieving smooth recovery.

Untested; I don't even have any DVDs or DVD images with multiple angles.
input: add a prefix to make any binding act on key repeat

The fact that it's a generic command prefix that is parsed even when
using the client API is a bit unclean (because this flag makes sense
for actual key-bindings only), but it's less code this way.
lua: add a way to add repeatable key bindings

For these, autorepeat is enabled.
travis: attempt to add Coverity integration

Not sure if this will work. Probably not, because it seems Coverity will
be missing some required dependencies.
build: don't build win32 mpv.com wrapper with --disable-cplayer

It'll be useless.
travis: another attempt

I guess it didn't like the duplicate env section.
travis: another attempt (2)

They said YAML is "simple"...
ao_lavc: fix dangling pointers

Found by Coverity.
audio/out/push: fix off-by-one error

Needs 1 additional free entry.

Found by Coverity.
demux_mkv: fix uninitialized variable

Found by Coverity.
demux_mkv: fix possible real-audio out of bounds accesses

Could index static arrays from arbitrary input data without checking for
bounds.

Found by Coverity.
demux_mkv: fix scary sign extension issues

Expressions involving uint16_t are promoted to int, which then can
overflow if the uint16_t values are large enough.

Found by Coverity.
ipc: fix confusion of write() return value and errno

Found by Coverity.
Remove some superfluous NULL checks

In all of these situations, NULL is logically not allowed, making the
checks redundant.

Coverity complained about accessing the pointers before checking them
for NULL later.
bstr: don't call memcpy(..., NULL, 0)

This is clearly not allowed, although it's not a problem on most libcs.

Found by Coverity.
stream: fix endian swapping

In addition to the messed-up expression, the endianness was also
inverted. The code reads big endian by default.

It "worked" by coincidence, but for little endian, codepoints outside of
latin1 were broken.

The broken expression was found by Coverity.
draw_bmp: make code more obvious, remove assertion

Silences a Coverity warning.

Also, drop the assert(); although it should be pretty much guaranteed
that things happen this way, it's still a bit fuzzy.