I have created a thread to update fmod
void ThreadProc(void *param)
{
while(threadactive==1){
FMOD_System_Update(fmodsystem);
Sleep(100);
}
_endthread();
}
[...]
handle = (HANDLE) _beginthread( ThreadProc,0,NULL);
[...]
I'm playing a wav with a syncpoint, when the syncpoint is reached my callback gets called.
FMOD_RESULT F_CALLBACK channelcallback(FMOD_CHANNEL * channel, FMOD_CHANNEL_CALLBACKTYPE type, unsigned int commanddata1, unsigned int commanddata2)
{
if(tempswitch==1){
result = FMOD_Channel_Stop(channel);
ERRCHECK(result);
tempswitch=0;
}
return FMOD_OK;
}
The program crashes on FMOD_Channel_Stop in the callback. "Stack overflow".
It ONLY happends when the callback gets called by reaching the syncpoint. Never if I do anything else.
Any thoughts on how to solve it?
I really need having the fmodupdate in a seperate thread.
Thanks
[Edited by - Marktheguy on December 17, 2008 7:24:36 AM]