More error handling improvements

HlsSampleSource:
    Fix if else mistake

Aes128DataSource:
    We can't start decryption at an arbitrary position.
    if start position isn't 0, we must start at 0 and
    throw away the bytes up to position after decryption.
HACK: Try to fix pause

Signed-off-by: Jonas Larsson <jonas@hallerud.se>
New shiny HLS bit rate adaption logic to combat buffering

Existing logic buffers way too often on a flaky connection (mobile).
This is a first attempt to make ExoPlayer behave more like iOS
where buffering is avoided at all costs. It's better UX to gear down
and fill up the buffer while playing than stopping playback and fill
the buffer with the same bit rate that didn't load fast enough.

The main problem with the existing adaptive code is the bandwidth
meter. It doesn't react to sudden bandwidth drops fast enough, and
the default weights aren't suitable for many HLS streams with long
segments and high bit rates.
Another big problem with ExoPlayer's HLS is that it loads the same
segment twice when switching variants. When we need to switch down
because the buffer is about to underrun, loading the same segment
again is pretty much guaranteed to cause buffering. This is fixed
in this repo but not upstream.

An app can of course pass in an enhanced custom bandwidth meter,
but at the library level we have more fine grained information
about things and can make better decisions. Until there's an
API for implementing an adaption decision maker, do things better
in the library.

In a nutshell this new logic is conservative gearing up and applies
a step function down as soon as a segment loads slowly. This is v1
code, it most likely still needs plenty of tuning.

Signed-off-by: Jonas Larsson <jonas@hallerud.se>