aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-08-30 20:25:07 +0000
committerPaweł Kołodziejski2003-08-30 20:25:07 +0000
commitc684a076eea7fbb79f5b695fe504f76f0ebac45d (patch)
tree4be0e08e0a17067e4634e542aca1bb268fa1501b /sound
parente7bebcf7aa718631159f0bb21ccd99d53f076c37 (diff)
downloadscummvm-rg350-c684a076eea7fbb79f5b695fe504f76f0ebac45d.tar.gz
scummvm-rg350-c684a076eea7fbb79f5b695fe504f76f0ebac45d.tar.bz2
scummvm-rg350-c684a076eea7fbb79f5b695fe504f76f0ebac45d.zip
revert id handle stuff
svn-id: r9927
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 6d36694933..14d8b41808 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -159,7 +159,7 @@ void SoundMixer::appendStream(int index, void *sound, uint32 size) {
void SoundMixer::endStream(int index) {
StackLock lock(_mutex);
- if (index == -1)
+ if (index == 0)
return;
ChannelStream *chan;
@@ -191,7 +191,7 @@ int SoundMixer::insertChannel(PlayingSoundHandle *handle, Channel *chan) {
_channels[index] = chan;
if (handle)
- *handle = index;
+ *handle = index + 1;
return index;
}
@@ -300,10 +300,10 @@ void SoundMixer::stopHandle(PlayingSoundHandle handle) {
StackLock lock(_mutex);
// Simply ignore stop requests for handles of sounds that already terminated
- if (handle == -1)
+ if (handle == 0)
return;
- int index = handle;
+ int index = handle - 1;
if ((index < 0) || (index >= NUM_CHANNELS)) {
warning("soundMixer::stopHandle has invalid index %d", index);
@@ -317,10 +317,10 @@ void SoundMixer::stopHandle(PlayingSoundHandle handle) {
bool SoundMixer::isChannelActive(PlayingSoundHandle handle) {
StackLock lock(_mutex);
- if (handle == -1)
+ if (handle == 0)
return false;
- int index = handle;
+ int index = handle - 1;
if ((index < 0) || (index >= NUM_CHANNELS)) {
warning("soundMixer::isChannelActive has invalid index %d", index);
return false;
@@ -388,7 +388,7 @@ Channel::~Channel() {
delete _converter;
delete _input;
if (_handle)
- *_handle = -1;
+ *_handle = 0;
}
void Channel::destroy() {