(svn r17146) -Codechange: improve the sample rate conversion a bit

This commit is contained in:
rubidium
2009-08-10 17:46:44 +00:00
parent 6800db65a7
commit 238b0e43bb
2 changed files with 24 additions and 5 deletions

View File

@@ -109,7 +109,11 @@ static bool SetBankSource(MixerChannel *mc, const SoundEntry *sound)
if (sound->file_size == 0) return false;
int8 *mem = MallocT<int8>(sound->file_size);
int8 *mem = MallocT<int8>(sound->file_size + 2);
/* Add two extra bytes so rate conversion can read these
* without reading out of it's input buffer. */
mem[sound->file_size ] = 0;
mem[sound->file_size + 1] = 0;
FioSeekToFile(sound->file_slot, sound->file_offset);
FioReadBlock(mem, sound->file_size);