cocoa: move CGL context creation to gl_cocoa

This approach is similar to what other vo_opengl backends do. It can also be
used in the future to create another cocoa backend that renders offscreen
with IOSurfaces or FBOs.
cocoa: simplify logic that returns used bits per color
demux: remove accurate_seek field

It's unused now. (Only the dvd code used it until recently.)
DOCS/tech-overview: minor updates
build: avoid defining _GNU_SOURCE

_GNU_SOURCE defines the kitchen sink, and also prefers glibc definitions
where glibc and POSIX conflict. Even though POSIX is worth less than
toilet paper, we still prefer the POSIX definitions.

rar.c needs asprintf(), which is _GNU_SOURCE-only. So we define
_GNU_SOURCE too specifically for this file.
build: deal with endian mess

There is no standard mechanism for detecting endianess. Doing it at
compile time in a portable way is probably hard. Doing it properly
with a configure check is probably hard too. Using the endian
definitions in <sys/types.h> (usually includes <endian.h>, which is
not available everywhere) works under circumstances, but the previous
commit broke it on OSX.

Ideally all code should be endian dependent, but that is not possible
due to the dependencies (such as FFmpeg, some video output APIs, some
audio output APIs).

Create a header osdep/endian.h, which contains various fallbacks.
Note that the last fallback uses libavutil; however, it's not clear
whether AV_HAVE_BIGENDIAN is a public symbol, or whether including
<libavutil/bswap.h> really makes it visible. And in fact we don't want
to pollute the namespace with libavutil definitions either. Thus it's
only the last fallback.
video/out: use strcmp() instead of strcasecmp() for equalizers

This makes it more consistent with the more important VOs.
build: include <strings.h> for strcasecmp()

It happens to work without strings.h on glibc or with _GNU_SOURCE, but
the POSIX standard requires including <strings.h>.

Hopefully fixes OSX build.
Revert "build: avoid defining _GNU_SOURCE"

This reverts commit 2e6a8f260ca169e2e1a5646eecfc322de6f77307.

Too many problems for now, such as with OSX and asprintf().
osc: round displayed cache value

Fixes #919
osc: improve previous commit
cache_file: fix operation if stream size is unknown

Happens when playing from a pipe.

Note that seeking forward doesn't work. It would be possible to create a
workaround for that by reading and skipping data until the target
position is reached (and writing the skipped data into the cache file),
but I'm not sure about that.

Fixes #928.

CC: @mpv-player/stable
stream: don't sleep for reconnecting network if playback is stopped

Also silences the bogus message if that happens.

CC: @mpv-player/stable
dvd: potentially fix video aspect ratio

This overwrote the source stream header, instead of the stream header
exported to the decoder.
config: skip BOM
input: skip BOM in input.conf
DOCS/release-policy: mention the release version in the RELEASE_NOTES template

Also suggest adding changes in point releases to RELEASE_NOTES as well.
stream_dvdnav: suspend read on vts change even if the requested title is not found
dvdnav: fix time display when starting in the middle of the DVD

libdvdnav can actually jump into the middle of the DVD (e.g. scene
selection menus do that). Then time display is incorrect: we start from
0, even though playback time is somewhere else. This really matters when
seeking. If the display time mismatches, a small relative seek will
apparently jump to the beginning of the movie.

Fix this by initializing the PTS stuff on opening. We have to do this
after some small amount of data has been read from the stream (because
libdvdnav is crap and doesn't always update the time between seeks and
the first read; also see STREAM_CTRL_GET_CURRENT_TIME remarks in
cache.c; although this was not observed when testing with scene
selection menus). On the other hand, we want to do it before opening the
demuxer, because that will read large amounts of data and likely will
change the stream position.

Also see commit 49813670.
audio: don't wait for draining if paused

Logic for this was missing from pull.c. For push.c it was missing if the
driver didn't support it. But even if the driver supported it (such as
with ao_alsa), strange behavior was observed by users. See issue #933.

Always check explicitly whether the AO is in paused mode, and if so,
don't drain.

Possibly fixes #933.

CC: @mpv-player/stable