Sorry this post is a little vague, but when my FSOUND_STREAMCALLBACK function returns, my application crashes at memory address 0x00000063.
-
I am using FSOUND_Stream_SetEndCallback to set the callback.
-
We have a custom memory manager, but when turned off, the crash still occurs.
-
I am using Microsoft Visual Studio .NET 2003.
-
The build uses the Multi-Threaded Debug option. (/MTd)
I don’t know if any of that is important, but please feel free to inquire about any of the other options as well. The stream plays fine. It’s just that when it ends, the callback is called, and then I get this weird crash.
If anyone knows what might be causing this, I’d appreciate your advice or ideas.
- SoundProgrammer asked 15 years ago
- You must login to post comments
As I said, it’s the wrong calling convention. You’ll need F_CALLBACKAPI in that declaration.
static signed char F_CALLBACKAPI FModStreamCallback( FSOUND_STREAM *stream, void *buff, int len, int param);
- Sly answered 15 years ago
- You must login to post comments
Been there, done that with the Delphi conversion.
- Sly answered 15 years ago
- You must login to post comments
Thanks Sly – you were exactly right. I used F_API as a test, and that worked too. I don’t think F_CALLBACKAPI is specified as being necessary with the function in the documentation (at least not in the FSOUND_STREAMCALLBACK specification). Maybe I missed something, but perhaps it should be included there.
Thanks again.
- SoundProgrammer answered 15 years ago
- You must login to post comments
What FMOD/other functions are you calling in your endcallback?
- Andrew Scott answered 15 years ago
- You must login to post comments
Sounds like the callback function has the wrong calling convention.
- Sly answered 15 years ago
- You must login to post comments
class FModAudioMgr
{
static signed char FModStreamCallback( FSOUND_STREAM *stream, void *buff, int len, int param)
{
return 1;
}
};
…
FSOUND_Stream_SetEndCallback(newStreamingP,
reinterpret_cast<FSOUND_STREAMCALLBACK> (FModAudioMgr::FModStreamCallback), 0);
That’s how I set everything up.
- SoundProgrammer answered 15 years ago
- You must login to post comments
Please login first to submit.