aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-07-06 11:33:28 +0000
committerFilippos Karapetis2009-07-06 11:33:28 +0000
commit250a1a915a6645baa5586aebfe5978730bca9b5b (patch)
tree60408dd1c02281b99ea722a4b5db9168ab40fe4b /engines/sci
parente182cc0b9fd7fff9148e69e3374acf027f72bf77 (diff)
downloadscummvm-rg350-250a1a915a6645baa5586aebfe5978730bca9b5b.tar.gz
scummvm-rg350-250a1a915a6645baa5586aebfe5978730bca9b5b.tar.bz2
scummvm-rg350-250a1a915a6645baa5586aebfe5978730bca9b5b.zip
When a song isn't found, send a "stop handle" event so that the engine won't wait forever (e.g. in SQ4CD, perhaps others)
svn-id: r42172
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/ksound.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index d6369cfcd1..17f085028f 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -809,7 +809,10 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
if (!GET_SEL32V(obj, nodePtr) && obj.segment) {
if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) {
warning("Could not open song number %d", number);
- return NULL_REG;
+ // Send a "stop handle" event so that the engine won't wait forever here
+ s->_sound.sfx_song_set_status(handle, SOUND_STATUS_STOPPED);
+ PUT_SEL32V(obj, signal, -1);
+ return s->r_acc;
}
debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);