aboutsummaryrefslogtreecommitdiff
path: root/insane.cpp
diff options
context:
space:
mode:
authorLionel Ulmer2002-06-02 20:30:21 +0000
committerLionel Ulmer2002-06-02 20:30:21 +0000
commit8b7207666e236988ebd568eeaa5386314f90cdb9 (patch)
tree8e861c514cc01fb411888582018a5699064e7995 /insane.cpp
parent4387c22d30298575b2c5a193d0b61a3080a9bd8c (diff)
downloadscummvm-rg350-8b7207666e236988ebd568eeaa5386314f90cdb9.tar.gz
scummvm-rg350-8b7207666e236988ebd568eeaa5386314f90cdb9.tar.bz2
scummvm-rg350-8b7207666e236988ebd568eeaa5386314f90cdb9.zip
Fix the streaming used in the movies in TheDig (warning, did not test
Full Throttle). This should be less buggy (ie crash less often, maybe not better quality) than the previous code. NOTE: the '1024 *' is here for testing purposes and will need to be severely reduced :-/ svn-id: r4396
Diffstat (limited to 'insane.cpp')
-rw-r--r--insane.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/insane.cpp b/insane.cpp
index fbaa7f1cb9..067b5a566b 100644
--- a/insane.cpp
+++ b/insane.cpp
@@ -133,6 +133,7 @@ void SmushPlayer::parseAHDR()
void SmushPlayer::parseIACT() {
unsigned int pos, bpos, tag, sublen, subpos, trk, idx, flags;
+ bool new_mixer = false;
byte * buf;
flags = SoundMixer::FLAG_AUTOFREE;
@@ -156,13 +157,14 @@ void SmushPlayer::parseIACT() {
g_scumm->_mixer->_channels[idx] == NULL) {
_imusTrk[idx] = trk;
_imusSize[idx] = 0;
+ new_mixer = true;
break;
}
}
}
if (idx == 8) {
- warning("iMUS table full\n");
+ warning("iMUS table full ");
return;
}
@@ -256,8 +258,11 @@ void SmushPlayer::parseIACT() {
debug(3, "trk %d: iMUSE play part, len 0x%x rate %d remain 0x%x",
trk, bpos, _imusRate[idx], _imusSubSize[idx]);
- g_scumm->_mixer->append(idx, buf, bpos,
- _imusRate[idx], flags);
+ if (new_mixer) {
+ g_scumm->_mixer->play_stream(NULL, idx, buf, bpos, _imusRate[idx], flags);
+ } else {
+ g_scumm->_mixer->append(idx, buf, bpos, _imusRate[idx], flags);
+ }
/* FIXME: append with re-used idx may cause problems
with signed/unsigned issues */
@@ -785,6 +790,7 @@ void SmushPlayer::parseFOBJ()
void SmushPlayer::parsePSAD() // FIXME: Needs to append to
{ // a sound buffer
unsigned int pos, sublen, tag, idx, trk;
+ bool new_mixer = false;
byte * buf;
pos = 0;
@@ -802,9 +808,10 @@ void SmushPlayer::parsePSAD() // FIXME: Needs to append to
for (idx = 0; idx < 8; idx++) {
if (_psadTrk[idx] == 0 &&
g_scumm->_mixer->_channels[idx] == NULL) {
- _psadTrk[idx] = trk;
- _saudSize[idx] = 0;
- break;
+ _psadTrk[idx] = trk;
+ _saudSize[idx] = 0;
+ new_mixer = true;
+ break;
}
}
}
@@ -852,9 +859,13 @@ void SmushPlayer::parsePSAD() // FIXME: Needs to append to
debug(3, "trk %d: SDAT part len 0x%x rate %d",
trk, sublen, _strkRate[idx]);
-
- g_scumm->_mixer->append(idx, buf, sublen,
- _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+
+ if (new_mixer) {
+ g_scumm->_mixer->play_stream(NULL, idx, buf, sublen, _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ } else {
+ g_scumm->_mixer->append(idx, buf, sublen,
+ _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ }
break;
case 'SMRK' :
_psadTrk[idx] = 0;