Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#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)

sword2.zip (936 bytes ) - added by SF/josemuk 17 years ago.
Savegame for Nico's Death

Download all attachments as: .zip

Change History (10)

by SF/josemuk, 17 years ago

Attachment: sword2.zip added

Savegame for Nico's Death

comment:1 by SF/josemuk, 17 years ago

I forgot. I'm using the Windows version.

comment:2 by eriktorbjorn, 17 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 eriktorbjorn, 17 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 eriktorbjorn, 17 years ago

Owner: set to eriktorbjorn

comment:5 by SF/josemuk, 17 years ago

Many thanks. That was a quick fix!

comment:6 by fingolfin, 17 years ago

Resolution: fixed
Status: newclosed

comment:7 by SF/josemuk, 17 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 eriktorbjorn, 17 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.

comment:9 by SF/josemuk, 17 years ago

Bug can be closed now :)

Many thanks.

Note: See TracTickets for help on using tickets.