0
0

I think I’m blowing the stack on the fmod stream callback. I’m running MacOS 9.1 and doing some cleanup when I get the callback from fmod stream instead of returning immediately and running my code on the next cycle. Any ideas? I’ve tested some code that returns right away and runs my code later, but I was hoping i could get some insight from the developpers on a possible solution. Is there an FMOD CodeWarrior project for the mac I could compile to figure out what exactly is going on?

thanks,

james

  • You must to post comments
0
0

Can you be more specific about your problem. For example what type of
cleanup are you doing in the callback? What type of callback is it?

I assume you are using a stream end callback.

If so – you can’t delete a stream from inside a callback. I think it’s something
to do with FMOD and the stream pointer: seems to me that FMOD is still
using the pointer when you exit the callback.

The way I got around that is to flag the stream for deletion on the next
application update.

Hope that helps

  • You must to post comments
0
0

Hi and thanks for the responses. Unfortunately, my delivery schedule is very tight and I haven’t had any free time to dig deep. But I promise to investigate my problem further sooner than later. Thanks for the thread info on the mac. As far as figuring out how much is on the stack when it barfs, dunno but I’m pretty sure it’s nowhere near 10k.

So now we’re just setting that flag and returning toute suite, using the ‘param’ (glad that’s in there) to fins our way back into object space.
(P.S. note the use of the stl map. this stuff ain’t console code. 😉 )

signed char globalScopeStreamCallback(FSOUND_STREAM* oJunk, void buff, int len, int param)
{
map<int,FMODStream
>::iterator itrStream = FMODStream::s_mapRegisteredStreams.find(param);

 if ( itrStream != FMODStream::s_mapRegisteredStreams.end() )
 { itrStream-&gt;second-&gt;StreamCallback(); }

 return 0;

}

// —————————————————————–

FMODStream::StreamCallback()
{
myFlags |= kHandleStreamCallbackFlag;
}

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.