0
0

Sorry this post is a little vague, but when my FSOUND_STREAMCALLBACK function returns, my application crashes at memory address 0x00000063.

  1. I am using FSOUND_Stream_SetEndCallback to set the callback.

  2. We have a custom memory manager, but when turned off, the crash still occurs.

  3. I am using Microsoft Visual Studio .NET 2003.

  4. 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.

  • You must to post comments
0
0

What FMOD/other functions are you calling in your endcallback?

  • You must to post comments
0
0

Sounds like the callback function has the wrong calling convention.

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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);

  • You must to post comments
0
0

Good call Sly! :)

  • You must to post comments
0
0

Been there, done that with the Delphi conversion. :)

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.