demux: add "BIKb" FourCC

More support for the worst codec ever.

Signed-off-by: wm4 <wm4@nowhere>
vd_lavc: by default, do not show corrupt frames

This flips the default value. Use --vd-lavc-show-all=yes to revert.
manpage: --ad-spdif-dtshd=yes works now

It was fixed a while ago. There are still some issues, as pointed
out in the manpage addition.
osc: fix playlist display
cache: always update cached controls after running a stream control

Seems like a good idea. One possible bad effect would be slowing down
uncached controls, but they're already slow. The good thing is that
many controls make intrusive changes to the stream (at least controls
which do write accesses), so the cached parameters should be updated.
cache: fix typo in comment
cache: move ringbuffer read into a separate function

No functional changes yet.
cache: no short reads in read_buffer

Until now, cache_read() (which calls read_buffer()) could return short
reads. This was a simplification allowed by the stream interface. But
for cache resizing, it will be more practical to make read_buffer() do
a full read.
cache: adjust stream position if necessary

Until now, this could never happen, because new data was simply always
appended to the end of the cache. But for making stream cache resizing
easier, doing it this way seems advantageous. It also makes it harder to
make the internal state inconsistent. (Before this change it could
happen that cache and stream position went out of sync if the read
position was adjusted "inappropriately".)
cache: minor simplification

The only difference is that the MP_DBG message is not printed anymore if
the current user read position is outside of the current cache range.

(In order to handle seek_limit==0 gracefully in the normal case of
linear reading, change the comparison from ">=" to ">".)
cache: allow resizing at runtime

The only tricky part is keeping the cache contents, which is made simple
by allocating the new cache while still keeping the old cache around,
and then copying the old data.

To explain the "Don't use this when playing DVD or Bluray." comment: the
cache also associates timestamps to blocks of bytes, but throws away the
timestamps on seek. Thus you will experience strange behavior after
resizing the cache until the old cached region is exhausted.
cache: simplify

Merge the cache_read function into cache_fill_buffer, since there's
not much reason to keep them separate. Also, simply call read_buffer()
to see if there's any readable data, instead of checking for the
condition manually.
client: add a comment
client: change equality rules for MPV_FORMAT_NONE
stream_file: Check the handle for network streams

Use NtQueryVolumeInformationFile instead of GetDriveType for detecting
remote filesystems on Windows. This has the advantage of working
directly on the file handle instead of needing a path and it works
unmodified in Cygwin where the previous code wouldn't understand Cygwin
paths or symlinks.

There is some risk in using NtQueryVolumeInformationFile, since it's an
internal function and its behaviour could change at any time or it could
be removed in a future version of Windows, however it's documented[1] in
the WDK and it's used successfully by Cygwin, so it should be fine. If
it's removed, the code should fail gracefully by treating all files as
local.

[1]: http://msdn.microsoft.com/en-us/library/windows/hardware/ff567070.aspx

Signed-off-by: wm4 <wm4@nowhere>
TOOLS: add script for using mpv with youtube-dl

Signed-off-by: wm4 <wm4@nowhere>
cache: fix checks/output on initialization

resize_cache() checks the size itself and clamps the size to the valid
range if necessary, so we don't need these checks. In fact, the checks
are different. Also, output the cache size after clamping, instead of
before.
cache: change a define to an enum

More consistent.
cache: fix description of the offset field

This field sure is a bit strange. I hope the description is correct now.
stream_dvd, cache: hack seeking with --cache + dvd:// back into working

This was broken at some unknown point (even before the recent cache
changes). There are several problems:
- stream_dvd returning a random stream position, confusing the cache
  layer (cached data and stream data lost their 1:1 corrospondence by
  position)
- this also confused the mechanism added with commit a9671524, which
  basically triggered random seeking (although this was not the only
  problem)
- demux_lavf requesting seeks in the stream layer, which resulted in
  seeks in the cache or the real stream

Fix this by completely removing byte-based seeking from stream_dvd. This
already works fine for stream_dvdnav and stream_bluray. Now all these
streams do time-based seeks, and pretend to be infinite streams of data,
and the rest of the player simply doesn't care about the stream byte
positions.