I recently moved over to monogame from XNA developing for Windows desktop mainly,
I’ve been searching all over for a solution and I was hoping someone here might point me in the right direction. I’ve read many posts that I could find with no real solution.
I’m trying to play a video in monogame (loop). I’ve noticed huge memory leaks ‘trying’ to loop the video via update function (player.state == Mediastate.stopped).
My problem is, is the property “IsLoop” implemented? I’ve tried both C# and VB with no luck.
My specs are:
OS: Windows 10 x64
Monogame: v3.7.1
VS: 2017
That was one of my first attempts. Are you suggesting polling via update method or timer?
I tried the update route:
This works fine, the problem is the memory. It starts off with +/- 80Mb, when the video plays a second time, the memory jumps to +/-130Mb and continues to do so every time the video plays again…180MB…220MB…and grows.
I do believe if you are only targeting one platform, you could just use more direct play methods? been a while so unable to expand on that theory but perhaps try a more direct approach? or are you trying to RT the video into a scene?
Are you pre-processing the video through the pipeline I think is what I mean, just try referencing the original video?
I’m back to square one with the memory leak on the video player. Many of my previous project uses “video” as background.
I’ve tried all sort of things but no luck. Removing everything code-wise and just playing the video player (no draw implementation or sprites etc) still causes memory leak by itself. Everything else I need to do can be done in Monogame expect for the “video player” issue.
I’ve also tried the dispose and allocate new player as suggested but then the player can’t play the video second time. Unless I’m missing something here.
Also tried the same with C# and VB to see if it’s language specific, but the same.
I also tried a forum user’s code snippet hoping it was implemented differently but have the same leak.
Does anyone have a code-snippet where it is actually works - no leak?