#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)
Change History (3)
by , 21 years ago
Attachment: | player_v2a_crashfix.diff added |
---|
comment:1 by , 21 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:2 by , 6 years ago
Component: | → Engine: SCUMM |
---|
player_v2a fix