ofDirectShowVideoPlayer icon indicating copy to clipboard operation
ofDirectShowVideoPlayer copied to clipboard

memory leak plus solution (?)

Open alexp-nl opened this issue 10 years ago • 2 comments

Hi Theodore, thanks for crafting the ofDirectShowVideoPlayer. It works like a charm, much better then the build-in player of openFrameWorks. However, I did come across a nasty memory leak. I created an of application showing short movie clips, with live generated graphics in between. After several hours, the application crashed. It turned out the be a memory leak problem. After some debugging, it turned out to be something in the video player. It leaked an amount of memory equal to the size of an rgb frame per loadMovie. And after several days of fruitless searching, I found the solution. The m_pGrabber->SetBufferSamples(TRUE) seems to be the problem. If the function is not called, or called with FALSE as the argument, the memory leak disappears, an the application runs for ever, without eating it's memory over time. I hope you can confirm that this call is not crucial for some other aspect of the player. At least for me, this solution seems to be working.

Best regards, Alex Prooper

alexp-nl avatar Jun 10 '15 10:06 alexp-nl

Thanks @alexp-nl - I'm going to post this to OF. https://github.com/openframeworks/openFrameworks/issues/3906

ofTheo avatar Jun 10 '15 11:06 ofTheo

Great @ofTheo !

alexp-nl avatar Jun 10 '15 11:06 alexp-nl