Can't play videos without leak

I can’t imagine something so broken making through testing, but I absolutely can’t see what I’m doing wrong - my code works with XNA.

Basically, playing a video is causing me to run out of memory really quickly. A small 250k video being played results in me hitting 2GB and crashing in a matter of seconds. I’m sure I’m doing something wrong, but, again, it works on XNA no problems.

I have a sample project available on Github:

Any help would be appreciated. I’m sure I’m missing something, but I just don’t know what.

Thank you.

Looks like bug in mono.

You can add a call to dispose the texture just before getting the next video frame like this:

if(videoFrame != null)
videoFrame.Dispose();

videoFrame = videoPlayer.GetTexture();

Is this ideal? Probably not, but it should prevent your game from eating up all your memory.

Chris

This excessive resource usage in VideoPlayer was rectified earlier this year.