0
0

Background:

I’m writing a media player application which uses FMOD for music, and DirectShow for video and DVD playback.

Problem:

Up to now I called FSOUND_Init and FSOUND_Close only once, during startup and shutdown of the app. This worked fine until I noticed that, even while my audio was paused or stopped (I even turned off the DSP unit), FMOD was still inflicting a significant CPU load. This is a problem when I’m trying to play back videos or DVDs, since the target system is of the 1Ghz mini-itx variety, and needs most of the CPU while playing back full-screen WMV.

Failed Solution:

I changed my architecture to release all FMOD resources (FSOUND_Shutdown) when going into video mode, with a corresponding re-initialization (FSOUND_Init) when coming back. Here’s where my problems started: for some reason, after calling FSOUND_Close(), I need to call FSOUND_Init() twice, since it always fails the first time (no matter how much time elapsese between the calls). Another problem I noticed is that the FSOUND_Close()/FSOUND_Init() combination seems to leak some memory (roughly 250K or so) each time. I did not do a scientific analysis on this, just glancing at the memory numbers for the app in windows task manager, which creep higher and higher.

Anyway, any help would be appreciated.. thanks!

Ralf

  • You must to post comments
0
0

same Problem here,after every mp3 got a +188 kb
many hours later my player used 32 MB 😮

  • You must to post comments
0
0

my Problem is solved
I use FSOUND_Stream_Close(stream) (not FSOUND_Stream_Stop(stream)) before playing a new mp3 😳

  • You must to post comments
0
0

Omg… how silly of me, that’s what my problem is too (with the memory leak at least). I missed this while re-architecting for the Init()/Close() strategy. Anyway, I’ll fix this and try it out again when I get home, maybe it will take care of the double initialization problem as well.

I didn’t think that there was a memory leak in this library, everything so far had been flawless and tight.

Ralf

  • You must to post comments
0
0

I fixed my broken code, and now the system behaves as expected… no more memory leaks and FSOUND_Init() is successful every time.

Thanks for your help brett and sos!

Ralf

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.