#3020 closed defect (fixed)
SWORD2: Crash after Nico's Death when trying to load/restart
Reported by: | SF/josemuk | Owned by: | eriktorbjorn |
---|---|---|---|
Priority: | normal | Component: | Engine: Sword2 |
Version: | Keywords: | ||
Cc: | Game: | Broken Sword 2 |
Description
I'm using the Spanish version with the latest ScummVM SVN. Try the attached savegame and wait for the guardian's shoot. After the movie, try to load a savegame or restart the game --> ScummVM crashes
Ticket imported from: #1645480. Ticket imported from: bugs/3020.
Attachments (1)
Change History (10)
by , 18 years ago
Attachment: | sword2.zip added |
---|
comment:2 by , 18 years ago
Thanks for spotting that! It should be fixed in SVN now, so it would be helpful if you could try the next daily Windows build.
Technical explanation: When playing a movie cutscene, there may be a "lead in" and/or "lead out" sound. The lead out starts when the movie is nearing the end. It used to be that the cutscene player would wait (showing only a black screen) until the lead out had finished. When I rewrote it to support DXA movies, in addition to the old MPEG ones, I decided that this was a bad idea because the lead out could go on for several seconds after the movie had finished.
To play a sound, ScummVM has to load it from file into memory. The mixer then reads short burtst of it every now and then, and sends the data to the sound card.
When the game is restarted or restored, almost all game data is released from memory. So all of a sudden, the mixer was trying to access memory that was no longer allocated. The result of that is unpredictable, but usually causes crashes like the one you saw.
I had already had to deal with this problem for normal in-game sound effects, so there was already a function to stop all the sound effects a room may have queued up. I've extended that to optionally kill the movie lead-in/out as well.
comment:3 by , 18 years ago
I forgot to say: You can probably avoid the crash by simply waiting a couple of seconds, until the sounds have stopped on their own, before you try to restore.
comment:4 by , 18 years ago
Owner: | set to |
---|
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 18 years ago
Just tried the latest SVN build: the game now only crashes if I restart the game (loading a saved game works fine)
comment:8 by , 18 years ago
That's why I didn't close the bug yesterday. ;-)
I had made a slight error in my earlier bugfix - a "false" wheren I meant "true" - so the sounds weren't stopped on restart as they should have been. Please try again with the next daily build.
Savegame for Nico's Death