aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/audio32.cpp
diff options
context:
space:
mode:
authorColin Snover2017-06-16 22:24:46 -0500
committerColin Snover2017-06-18 21:42:58 -0500
commit733eaeb499bb39f75e7dd218df4c71b06b7e1610 (patch)
tree690d123bb2f898a494a1f7859ccf6265b3486e65 /engines/sci/sound/audio32.cpp
parentdc9522eae09ea740a5b1458dc1f6ffeff4032532 (diff)
downloadscummvm-rg350-733eaeb499bb39f75e7dd218df4c71b06b7e1610.tar.gz
scummvm-rg350-733eaeb499bb39f75e7dd218df4c71b06b7e1610.tar.bz2
scummvm-rg350-733eaeb499bb39f75e7dd218df4c71b06b7e1610.zip
SCI32: Minor tweaks to improve code clarity & consistency
Diffstat (limited to 'engines/sci/sound/audio32.cpp')
-rw-r--r--engines/sci/sound/audio32.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index 753d7d4bbb..5e75095e5a 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -232,7 +232,7 @@ bool Audio32::channelShouldMix(const AudioChannel &channel) const {
// completely fill the audio buffer, the functionality of
// all these original functions is combined here and
// simplified.
-int Audio32::readBuffer(Audio::st_sample_t *buffer, const int numSamples) {
+int Audio32::readBuffer(Audio::st_sample_t *const buffer, const int numSamples) {
Common::StackLock lock(_mutex);
if (_pausedAtTick != 0 || _numActiveChannels == 0) {
@@ -244,7 +244,6 @@ int Audio32::readBuffer(Audio::st_sample_t *buffer, const int numSamples) {
// the same time we need to be able to clear out any
// finished channels on a regular basis
_inAudioThread = true;
-
freeUnusedChannels();
const bool playOnlyMonitoredChannel = getSciVersion() != SCI_VERSION_3 && _monitoredChannelIndex != -1;
@@ -476,7 +475,7 @@ void Audio32::lockResource(const ResourceId resourceId, const bool lock) {
void Audio32::freeUnusedChannels() {
Common::StackLock lock(_mutex);
- for (int channelIndex = 0; channelIndex < _numActiveChannels; ++channelIndex) {
+ for (int16 channelIndex = 0; channelIndex < _numActiveChannels; ++channelIndex) {
const AudioChannel &channel = getChannel(channelIndex);
if (!channel.robot && channel.stream->endOfStream()) {
if (channel.loop) {