Opened 21 years ago

Closed 21 years ago

Last modified 6 years ago

#8286 closed patch

player_v2a - fix crash when playing two identical sounds

Reported by: SF/quietust Owned by: Kirben
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game:

Description

My original player_v2a code simply maintained a list of sound objects which would be directly called to start and stop playback; the object selected is based on the CRC-32 of the code segment in the sound resource. There's just one problem - there are multiple sound resources which share the same code (and often data) segments, and if two of them are played simultaneously it will cause problems (only one sound will play, it will play at double speed, and when the 2nd sound is stopped ScummVM will crash).

In Maniac Mansion, the problem could be observed when turning off the circuit breakers (alarm plays at double speed, crashes when the alarm stops) or running at Turbo speed (Ctrl+F) while using the Hunk-O-Matic.

The attached patch fixes this by adding a copy() method to class V2A_Sound and appropriate copy constructors to each of the subclasses (and deleting the copy when the sound is done playing).

Ticket imported from: #820427. Ticket imported from: patches/391.

Attachments (1)

player_v2a_crashfix.diff (16.1 KB ) - added by SF/quietust 21 years ago.
player_v2a fix

Download all attachments as: .zip

Change History (3)

by SF/quietust, 21 years ago

Attachment: player_v2a_crashfix.diff added

player_v2a fix

comment:1 by Kirben, 21 years ago

Owner: set to Kirben
Status: newclosed

comment:2 by digitall, 6 years ago

Component: Engine: SCUMM
Note: See TracTickets for help on using tickets.