aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2003-07-06 17:00:09 +0000
committerMax Horn2003-07-06 17:00:09 +0000
commit7e4fa4a1da468343fc5d5b9e2b62257611920cb2 (patch)
treedb7c9f10aacb76a6dc42fdabd30ba523929ffb26 /sound
parentb6c3d440b57aa792c5464babe0bb7ad4eb9b5f2c (diff)
downloadscummvm-rg350-7e4fa4a1da468343fc5d5b9e2b62257611920cb2.tar.gz
scummvm-rg350-7e4fa4a1da468343fc5d5b9e2b62257611920cb2.tar.bz2
scummvm-rg350-7e4fa4a1da468343fc5d5b9e2b62257611920cb2.zip
mix() is really a private method, only to be called by the audio thread; cover setupPremix by the mutex, too (that helps preventing race conditions upon exit)
svn-id: r8809
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp1
-rw-r--r--sound/mixer.h10
2 files changed, 6 insertions, 5 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 666f31e1a7..6be55b866d 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -356,6 +356,7 @@ bool SoundMixer::isActiveChannel(int index) {
}
void SoundMixer::setupPremix(void *param, PremixProc *proc) {
+ StackLock lock(_mutex);
_premixParam = param;
_premixProc = proc;
}
diff --git a/sound/mixer.h b/sound/mixer.h
index 5cea147749..e5e9149132 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -51,8 +51,6 @@ public:
};
private:
- static void onGenerateSamples(void *s, byte *samples, int len);
-
OSystem *_syst;
OSystem::MutexRef _mutex;
@@ -95,9 +93,6 @@ public:
/** Premix procedure, useful when using fmopl adlib */
void setupPremix(void * param, PremixProc * proc);
- /** mix */
- void mix(int16 * buf, uint len);
-
/** stop all currently playing sounds */
void stopAll();
@@ -138,6 +133,11 @@ public:
private:
int insertChannel(PlayingSoundHandle *handle, Channel *chan);
+
+ /** mix */
+ void mix(int16 * buf, uint len);
+
+ static void onGenerateSamples(void *s, byte *samples, int len);
};
#endif