[Scummvm-cvs-logs] SF.net SVN: scummvm: [30275] scummvm/trunk/engines/scumm/imuse_digi/ dimuse_track.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 6 00:44:06 CET 2008


Revision: 30275
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30275&view=rev
Author:   fingolfin
Date:     2008-01-05 15:44:05 -0800 (Sat, 05 Jan 2008)

Log Message:
-----------
stop low priority sounds which we want to override immediatly

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp	2008-01-05 23:38:45 UTC (rev 30274)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp	2008-01-05 23:44:05 UTC (rev 30275)
@@ -60,17 +60,18 @@
 		if (lowest_priority <= priority) {
 			assert(trackId != -1);
 			Track *track = _track[trackId];
-			// FIXME: Should we really wait for the sound to finish "nicely"?
-			// Why not just stop it immediately?
-			
-			while (track->used) {
-				// The designated track is not yet available. So, we call flushTrack()
-				// to get it processed (and thus made ready for us). Since the actual
-				// processing is done by another thread, we also call parseEvents to
-				// give it some time (and to avoid busy waiting/looping).
-				flushTrack(track);
-				_vm->parseEvents();
+
+			// Stop the track immediately
+			_mixer->stopHandle(track->mixChanHandle);
+			if (!track->souStreamUsed) {
+				assert(track->stream);
+				delete track->stream;
+				_sound->closeSound(track->soundDesc);
 			}
+
+			// Mark it as unused
+			memset(track, 0, sizeof(Track));
+
 			debug(5, "IMuseDigital::allocSlot(): Removed sound %d from track %d", _track[trackId]->soundId, trackId);
 		} else {
 			debug(5, "IMuseDigital::allocSlot(): Priority sound too low");


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list