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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 6 14:54:20 CET 2008


Revision: 30298
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30298&view=rev
Author:   fingolfin
Date:     2008-01-06 05:54:19 -0800 (Sun, 06 Jan 2008)

Log Message:
-----------
Fix bug #1864932: COMI: Game crashes on difficulty selection screen

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

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2008-01-06 13:30:44 UTC (rev 30297)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2008-01-06 13:54:19 UTC (rev 30298)
@@ -218,9 +218,11 @@
 	for (int l = 0; l < MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS; l++) {
 		Track *track = _track[l];
 		if (track->used) {
-			// Remove tracks if necessary
-			if (!_mixer->isSoundHandleActive(track->mixChanHandle)) {
-				memset(track, 0, sizeof(Track));
+			// Ignore tracks which are about to finish. Also, if it did finish in the meantime,
+			// mark it as unused.
+			if (!track->stream) {
+				if (!_mixer->isSoundHandleActive(track->mixChanHandle))
+					memset(track, 0, sizeof(Track));
 				continue;
 			}
 
@@ -260,7 +262,7 @@
 
 				if (track->curRegion == -1) {
 					switchToNextRegion(track);
-					if (track->toBeRemoved || !track->used)
+					if (!track->stream)	// Seems we reached the end of the stream
 						continue;
 				}
 
@@ -328,7 +330,7 @@
 
 					if (_sound->isEndOfRegion(track->soundDesc, track->curRegion)) {
 						switchToNextRegion(track);
-						if (track->toBeRemoved || !track->used)
+						if (!track->stream)	// Seems we reached the end of the stream
 							break;
 					}
 					feedSize -= curFeedSize;


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