[Scummvm-cvs-logs] scummvm master -> a21c9ef913179fcceef82e2e926e8fc78665f8b0

lordhoto lordhoto at gmail.com
Sun Jun 22 15:13:09 CEST 2014


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5be5f36aa9 SCUMM: Clear SFX channel when starting the SFX failed in AD player.
a21c9ef913 SCUMM: Don't allow SFX to reallocate their own channels in AD player.


Commit: 5be5f36aa90ecb09cde5a3d207860906bb6975f6
    https://github.com/scummvm/scummvm/commit/5be5f36aa90ecb09cde5a3d207860906bb6975f6
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2014-06-22T14:53:38+02:00

Commit Message:
SCUMM: Clear SFX channel when starting the SFX failed in AD player.

Changed paths:
    engines/scumm/players/player_ad.cpp



diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp
index 1176a62..2d8de3a 100644
--- a/engines/scumm/players/player_ad.cpp
+++ b/engines/scumm/players/player_ad.cpp
@@ -137,6 +137,18 @@ void Player_AD::startSound(int sound) {
 		if (startSfx(sfx, res)) {
 			// Lock the new resource
 			_vm->_res->lock(rtSound, sound);
+		} else {
+			// When starting the sfx failed we need to reset the slot.
+			sfx->resource = -1;
+
+			for (int i = 0; i < ARRAYSIZE(sfx->channels); ++i) {
+				sfx->channels[i].state = kChannelStateOff;
+
+				if (sfx->channels[i].hardwareChannel != -1) {
+					freeHWChannel(sfx->channels[i].hardwareChannel);
+					sfx->channels[i].hardwareChannel = -1;
+				}
+			}
 		}
 	}
 }


Commit: a21c9ef913179fcceef82e2e926e8fc78665f8b0
    https://github.com/scummvm/scummvm/commit/a21c9ef913179fcceef82e2e926e8fc78665f8b0
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2014-06-22T14:53:38+02:00

Commit Message:
SCUMM: Don't allow SFX to reallocate their own channels in AD player.

Changed paths:
    engines/scumm/players/player_ad.cpp



diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp
index 2d8de3a..a8d9dbf 100644
--- a/engines/scumm/players/player_ad.cpp
+++ b/engines/scumm/players/player_ad.cpp
@@ -314,7 +314,10 @@ int Player_AD::allocateHWChannel(int priority, SfxSlot *owner) {
 
 	// Second pass: Reassign channels based on priority
 	for (int i = 0; i < _numHWChannels; ++i) {
-		if (_hwChannels[i].priority <= priority) {
+		// We don't allow SFX to reallocate their own channels. Otherwise we
+		// would call stopSfx in the midst of startSfx and that can lead to
+		// horrible states...
+		if (_hwChannels[i].priority <= priority && (!owner || _hwChannels[i].sfxOwner != owner)) {
 			// In case the HW channel belongs to a SFX we will completely
 			// stop playback of that SFX.
 			// TODO: Maybe be more fine grained in the future and allow






More information about the Scummvm-git-logs mailing list