The eliminated code removes the (ch == 1) branch, which is scoped
within this if condition: `if (rtype == 2 && ch != 1)`, therefore
the (ch == 1) branch will never be taken.
In the call to decode_residue:
decode_residue(f, residue_buffers, ch, n2, r, do_not_decode);
The channel count is previously intialized as zero and incremented
based on a for-loop (f->channels) plus a conditional,
if (map->chan[j].mux == i). If this doesn't happen then 'ch'
remains zero.
Once inside decode_residue(..), the code has three branches based
on channel count: stereo (ch == 2), mono (ch == 1), and then the
exception if it's neither of those (simple 'else'). It's in here
where a zero-valued 'ch' can be used as the denominator in these
calculations:
int c_inter = z % ch
p_inter = z/ch;
Obviously this 'else' branch is meant for channel counts greater
than two an not for zero channels; so this change simply makes
that branch only valid if (ch > 2).
- Removes extraneous (and unused) includes
- Cleans up many compiler warnings
- Fixes SDL include statements (using proper `#include <file.h>` directives
given the prior `#include "file.h"` directives should only be used when
including a projects' own header files instead of -Ipath-provided system
headers)
- Eliminates extraneous codecs
Many of these were made after building SDL_Sound under various compilers
and operating systems and hitting various issues. It currently builds
clean without errors or warnings on all our workflow compilers and
versions.