aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2003-07-12 11:33:13 +0000
committerMax Horn2003-07-12 11:33:13 +0000
commit1e0b7aaa16d6caeca1d67f383297f7ed619348f9 (patch)
treee2bfee8baf14a913645f73692ef87c39345d0e72 /sound
parent524991b07368c70a6b14ba713b0e27b9150f1b51 (diff)
downloadscummvm-rg350-1e0b7aaa16d6caeca1d67f383297f7ed619348f9.tar.gz
scummvm-rg350-1e0b7aaa16d6caeca1d67f383297f7ed619348f9.tar.bz2
scummvm-rg350-1e0b7aaa16d6caeca1d67f383297f7ed619348f9.zip
verify chan != 0 even on WinCE
svn-id: r8940
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 0436aa78a2..fa0f05a54f 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -191,33 +191,33 @@ SoundMixer::~SoundMixer() {
void SoundMixer::appendStream(int index, void *sound, uint32 size) {
StackLock lock(_mutex);
+ ChannelStream *chan;
#ifndef _WIN32_WCE
- ChannelStream *chan = dynamic_cast<ChannelStream *>(_channels[index]);
+ chan = dynamic_cast<ChannelStream *>(_channels[index]);
+#else
+ chan = (ChannelStream*)_channels[index];
+#endif
if (!chan) {
error("Trying to append to a nonexistant stream %d", index);
} else {
chan->append(sound, size);
}
-#else
- ChannelStream *chan = (ChannelStream*)_channels[index];
- chan->append(sound, size);
-#endif
}
void SoundMixer::endStream(int index) {
StackLock lock(_mutex);
+ ChannelStream *chan;
#ifndef _WIN32_WCE
- ChannelStream *chan = dynamic_cast<ChannelStream *>(_channels[index]);
+ chan = dynamic_cast<ChannelStream *>(_channels[index]);
+#else
+ chan = (ChannelStream*)_channels[index];
+#endif
if (!chan) {
error("Trying to end a nonexistant streamer : %d", index);
} else {
chan->finish();
}
-#else
- ChannelStream *chan = (ChannelStream*)_channels[index];
- chan->finish();
-#endif
}
int SoundMixer::insertChannel(PlayingSoundHandle *handle, Channel *chan) {