Fix the AUTOFREE problem on TheDig sounds. 'Proper' fix may come later

if I get answers on my -devel post :-)

svn-id: r4159
This commit is contained in:
Lionel Ulmer 2002-05-01 12:57:12 +00:00
parent 786f9914c9
commit 75f0674e46

View File

@ -681,7 +681,6 @@ void Scumm::decompressBundleSound(int index) {
int i, z;
COMP_table table[50];
static unsigned char *CompInput, *CompOutput, *CompFinal;
static bool initted;
int outputSize, finalSize;
fileSeek(_sfxFile, bundle_table[index].offset, SEEK_SET);
@ -703,10 +702,7 @@ void Scumm::decompressBundleSound(int index) {
fileReadDwordBE(_sfxFile);
}
if (!initted) {
CompFinal = (unsigned char *)alloc(1000000);
initted = true;
}
CompFinal = (unsigned char *)malloc(1000000);
finalSize = 0;
@ -749,7 +745,7 @@ void Scumm::decompressBundleSound(int index) {
default:
printf("Unknown codec %d!\n", table[i].codec);
break;
}
}
memcpy(&CompFinal[finalSize], &CompOutput[0], outputSize);
finalSize+=outputSize;
@ -759,9 +755,9 @@ void Scumm::decompressBundleSound(int index) {
}
/* FIXME: This is nasty. We are actually sending the whole
decompressed packet to the mixer.. but the packet
actually contains further subblocks! (eg, sync) */
_mixer->play_raw(NULL, CompFinal, finalSize,22050, SoundMixer::FLAG_UNSIGNED);
decompressed packet to the mixer.. but the packet
actually contains further subblocks! (eg, sync) */
_mixer->play_raw(NULL, CompFinal, finalSize, 22050, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
}
void Scumm::playBundleSound(char *sound)