[Scummvm-cvs-logs] scummvm master -> 2c5a0008badb2c89d1c3f62f7c8b105b22ed8a19

DrMcCoy drmccoy at drmccoy.de
Sun Apr 28 17:40:48 CEST 2013


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:
2c5a0008ba AUDIO: Do not error out when channel offset >= length after interrupt()


Commit: 2c5a0008badb2c89d1c3f62f7c8b105b22ed8a19
    https://github.com/scummvm/scummvm/commit/2c5a0008badb2c89d1c3f62f7c8b105b22ed8a19
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2013-04-28T08:31:53-07:00

Commit Message:
AUDIO: Do not error out when channel offset >= length after interrupt()

This fixes a Protracker module in the OS/2 version of
Hopkins FBI (bug #3612101). In row 0x30 of the first
pattern, the set channel offset effect in the fourth track
pushes the offset past the sample (repeat) length.
This is not error; the mixing function already handles this
case flawlessly. No assert() is necessary there.

Changed paths:
    audio/mods/paula.cpp



diff --git a/audio/mods/paula.cpp b/audio/mods/paula.cpp
index 4b49d6e..d655428 100644
--- a/audio/mods/paula.cpp
+++ b/audio/mods/paula.cpp
@@ -132,7 +132,14 @@ int Paula::readBufferIntern(int16 *buffer, const int numSamples) {
 			Channel &ch = _voice[voice];
 			int16 *p = buffer;
 			int neededSamples = nSamples;
-			assert(ch.offset.int_off < ch.length);
+
+			// NOTE: A Protracker (or other module format) player might actually
+			// push the offset past the sample length in its interrupt(), in which
+			// case the first mixBuffer() call should not mix anything, and the loop
+			// should be triggered.
+			// Thus, doing an assert(ch.offset.int_off < ch.length) here is wrong.
+			// An example where this happens is a certain Protracker module played
+			// by the OS/2 version of Hopkins FBI.
 
 			// Mix the generated samples into the output buffer
 			neededSamples -= mixBuffer<stereo>(p, ch.data, ch.offset, rate, neededSamples, ch.length, ch.volume, ch.panning);






More information about the Scummvm-git-logs mailing list