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

fuzzie fuzzie at fuzzie.org
Mon May 16 15:12:08 CEST 2011


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:
ed1739f419 AUDIO: Clarify required parameters for mixCallback.


Commit: ed1739f4197b98043bd6ae1a2a181e3f410279d7
    https://github.com/scummvm/scummvm/commit/ed1739f4197b98043bd6ae1a2a181e3f410279d7
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-05-16T06:09:05-07:00

Commit Message:
AUDIO: Clarify required parameters for mixCallback.

Also, add an assert() to make invalid lengths obvious.

Changed paths:
    audio/mixer.cpp
    audio/mixer_intern.h



diff --git a/audio/mixer.cpp b/audio/mixer.cpp
index 3482bd3..fb4fffb 100644
--- a/audio/mixer.cpp
+++ b/audio/mixer.cpp
@@ -257,6 +257,8 @@ int MixerImpl::mixCallback(byte *samples, uint len) {
 	Common::StackLock lock(_mutex);
 
 	int16 *buf = (int16 *)samples;
+	// we store stereo, 16-bit samples
+	assert(len % 4 == 0);
 	len >>= 2;
 
 	// Since the mixer callback has been called, the mixer must be ready...
diff --git a/audio/mixer_intern.h b/audio/mixer_intern.h
index 05e519c..a04eb55 100644
--- a/audio/mixer_intern.h
+++ b/audio/mixer_intern.h
@@ -126,6 +126,8 @@ public:
 	 * the backend (e.g. from an audio mixing thread). All the actual mixing
 	 * work is done from here.
 	 *
+	 * @param samples Sample buffer, in which stereo 16-bit samples will be stored.
+	 * @param len Length of the provided buffer to fill (in bytes, should be divisible by 4).
 	 * @return number of sample pairs processed (which can still be silence!)
 	 */
 	int mixCallback(byte *samples, uint len);






More information about the Scummvm-git-logs mailing list