[Scummvm-git-logs] scummvm master -> 2808192828a44590ac004c939d96454ecf593631

criezy noreply at scummvm.org
Wed Mar 29 21:07:05 UTC 2023


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

Summary:
2808192828 AGS: fixed find_free_audio_channel() incorrect compat fix


Commit: 2808192828a44590ac004c939d96454ecf593631
    https://github.com/scummvm/scummvm/commit/2808192828a44590ac004c939d96454ecf593631
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-03-29T22:02:38+01:00

Commit Message:
AGS: fixed find_free_audio_channel() incorrect compat fix

>From upstream b3f4909.

Fixes a regression from d2b0380 (86564e9 in upstream)  where the extra
channel allowance was added excessively for all cases.

Fixes bug #14353 (crash in unavowed).

Changed paths:
    engines/ags/engine/media/audio/audio.cpp


diff --git a/engines/ags/engine/media/audio/audio.cpp b/engines/ags/engine/media/audio/audio.cpp
index b383b568c99..ff0b4da5ffa 100644
--- a/engines/ags/engine/media/audio/audio.cpp
+++ b/engines/ags/engine/media/audio/audio.cpp
@@ -155,7 +155,7 @@ static int find_free_audio_channel(ScriptAudioClip *clip, int priority, bool int
 
 	// NOTE: in backward compat mode we allow to place sound on a crossfade channel
 	int startAtChannel = _G(reserved_channel_count);
-	int endBeforeChannel = _GP(game).numCompatGameChannels;
+	int endBeforeChannel = _GP(game).numGameChannels;
 
 	if (_GP(game).audioClipTypes[clip->type].reservedChannels > 0) {
 		startAtChannel = 0;
@@ -163,6 +163,7 @@ static int find_free_audio_channel(ScriptAudioClip *clip, int priority, bool int
 			startAtChannel += MIN(MAX_SOUND_CHANNELS,
 				_GP(game).audioClipTypes[i].reservedChannels);
 		}
+		// NOTE: we allow to place sound on a crossfade channel for backward compatibility
 		endBeforeChannel = MIN(_GP(game).numCompatGameChannels,
 			startAtChannel + _GP(game).audioClipTypes[clip->type].reservedChannels);
 	}




More information about the Scummvm-git-logs mailing list