aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2007-02-15 12:47:09 +0000
committerMax Horn2007-02-15 12:47:09 +0000
commit8cef52294cb4e8898b1cba14348f7e4021684bad (patch)
tree8ad26ab38829b7f59c71224055edd8aee5935cb6
parent57f529e36eede4b8809e84508fc095976c796bc4 (diff)
downloadscummvm-rg350-8cef52294cb4e8898b1cba14348f7e4021684bad.tar.gz
scummvm-rg350-8cef52294cb4e8898b1cba14348f7e4021684bad.tar.bz2
scummvm-rg350-8cef52294cb4e8898b1cba14348f7e4021684bad.zip
Fix for bug #1660559: MANIAC/ZAK: Music does not stop when pausing (regression)
svn-id: r25605
-rw-r--r--sound/mixer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 2cb1063828..1712209237 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -246,7 +246,7 @@ void Mixer::mix(int16 *buf, uint len) {
// zero the buf
memset(buf, 0, 2 * len * sizeof(int16));
- if (_premixChannel)
+ if (_premixChannel && !_premixChannel->isPaused())
_premixChannel->mix(buf, len);
// now mix all channels
@@ -270,13 +270,16 @@ void Mixer::mixCallback(void *s, byte *samples, int len) {
void Mixer::stopAll(bool force) {
Common::StackLock lock(_mutex);
- for (int i = 0; i != NUM_CHANNELS; i++)
+ for (int i = 0; i != NUM_CHANNELS; i++) {
if (_channels[i] != 0) {
if (force || !_channels[i]->isPermanent()) {
delete _channels[i];
_channels[i] = 0;
}
}
+ }
+
+ // Note: the _premixChannel is *not* affected by stopAll!
}
void Mixer::stopID(int id) {
@@ -338,6 +341,10 @@ void Mixer::pauseAll(bool paused) {
_channels[i]->pause(paused);
}
}
+
+ // Unlike stopAll, we also pause the premix channel, if present.
+ if (_premixChannel)
+ _premixChannel->pause(paused);
}
void Mixer::pauseID(int id, bool paused) {