[ scummvm-Patches-820427 ] player_v2a - fix crash when playing two identical sounds

SourceForge.net noreply at sourceforge.net
Thu Oct 9 07:04:51 CEST 2003


Patches item #820427, was opened at 2003-10-09 00:04
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=820427&group_id=37116

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Quietust (quietust)
Assigned to: Nobody/Anonymous (nobody)
Summary: player_v2a - fix crash when playing two identical sounds

Initial Comment:
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).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=820427&group_id=37116




More information about the Scummvm-tracker mailing list