aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorLionel Ulmer2002-05-01 12:57:12 +0000
committerLionel Ulmer2002-05-01 12:57:12 +0000
commit75f0674e465e628a9a6a5a7cc56e45609ac2e6d3 (patch)
treeb6b93a362a56568806d39f580a2326d6053e6b21 /sound.cpp
parent786f9914c92087365c2256c65a61602bb02068d6 (diff)
downloadscummvm-rg350-75f0674e465e628a9a6a5a7cc56e45609ac2e6d3.tar.gz
scummvm-rg350-75f0674e465e628a9a6a5a7cc56e45609ac2e6d3.tar.bz2
scummvm-rg350-75f0674e465e628a9a6a5a7cc56e45609ac2e6d3.zip
Fix the AUTOFREE problem on TheDig sounds. 'Proper' fix may come later
if I get answers on my -devel post :-) svn-id: r4159
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound.cpp b/sound.cpp
index a29da2d396..ab6336b5cc 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -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)