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
This commit is contained in:
Max Horn 2003-07-06 17:00:09 +00:00
parent b6c3d440b5
commit 7e4fa4a1da
2 changed files with 6 additions and 5 deletions

View File

@ -356,6 +356,7 @@ bool SoundMixer::isActiveChannel(int index) {
}
void SoundMixer::setupPremix(void *param, PremixProc *proc) {
StackLock lock(_mutex);
_premixParam = param;
_premixProc = proc;
}

View File

@ -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