The parser previously computed the offset of the coefficients field of
channel 0's ADPCM header and then skipped 0x38 bytes to get to the
coefficients field of the next channel's ADPCM header. This breaks for
some files because they have larger 0x3a byte ACPCM headers.
This commit updates the logic to compute the offset of each channel's
ADPCM header. Immediately after the HEAD part 3 header, there's an
8-byte table for each channel, where the second field indicates the
offset of that channel's ADPCM header. With this information, it's just
a matter of adding 0x08 to get the coefficients field.
Fixes: #674
Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Remove layout_interleave_shortblock for clarity as the value is enough
to signal its use. Also fix .snd last block calculation, and clean some
metas since I was testing changes anyway.
stdio optimizations include the prevention of 'doubly opening' a file. If a file is opened that is already opened, the file handle is duplicated instead of using the normal fopen call.
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@180 51a99a44-fe44-0410-b1ba-c3e57ba2b86b