decoer/dsf: fix endless loop on malformed file

When the data chunk size is not a multiple of the frame size, the last
partial frame lead to an endless loop.  We fix this by checking
chunk_sze>=frame instead of chunk_sze>0.  This way, the partial frame
is simply skipped.
decoer/dsdiff: fix endless loop on malformed file

Same bug as in the previous commit.
Merge branch 'v0.18.x'
decoder/dsf: make the "scratch" buffer local

This allows the compiler to discard buffer contents between two
function calls.
decoder/dsf: use memcpy()
decoder/dsf: use size_t loop variables when the limit is a size_t
decoder/dsf: add constant DSF_BLOCK_SIZE
decoder/dsf: eliminate temporary buffer

Convert into a second buffer that gets passed to decoder_data()
without copying back to the first buffer.
decoder/dsf: fix noise at end of malformed file

Read one block at a time.  This discards the last partial block, which
cannot be interleaved anyway.  Previously, uninitialised memory was
used to interleave the last block, which generated some noise.
decoder/dsf: simplify dsf_to_pcm_order()

Don't pass the buffer size to the function, as it's known at compile
time.  Use "restrict" on the pointer arguments, and merge the two
loops, which allows the compiler to optimize this loop with a few SSE2
instructions.
decoder/dsf: fix multi-channel files

The plugin was horribly bugged for files that were not stereo.
decoder/dsf: compare with InputStream::GetRest() instead of ..GetSize()
decoder/dsf: fix big-endian bugs
decoder/dsf: eliminate another hard-coded stereo mode assumption

When calculating the upper bound using the "sample count" format
header, don't assume it's stereo.
decoder/dsf: allow channel setups other than stereo

This finishes the multi-channel support.  Development of the feature
was started with commit 02cc77cd8
decoder/dsf: count the blocks, not the remaining bytes

Prepare refactoring the whole plugin to use blocks instead of bytes.
A block is the smallest addressable unit, and it will simplify the
seeking code.
decoder/dsf: don't skip remaining bytes

Nobody cares.
decoder/dsf: use the block count internally
decoder/dsf: eliminate pointless return statement
decoder/dsf: make the buffer more local

This allows the compiler to discard buffer contents between two
iterations.