Meta.Vlc
Meta.Vlc copied to clipboard
Not enough storage is available to process this command. (Exception from HRESULT: 0x80070008)
Hello,
I am using Meta Vlc and creating multiple VlcPlayers in succession.
My program displays multiple videos in sequence (each around 100 mb and lasts about 10 seconds)
I get the error in the title after creating around 100 VlcPlayers
I am using
video = new VlcPlayer(); video.Stretch = System.Windows.Media.Stretch.Fill; video.EndBehavior = EndBehavior.Stop;
parent.Children.Add(video);
video.LoadMedia(media); video.Loaded += callback;
i have snooped around the code and found that when i call dispose i don't see the handlers for the player being disposed maybe that is the issue maybe not i am not that deep into coding.
Any help would be appreciated :D
I spend the last 2 days debugging this error with no luck.
I am creating new VlcPlayer for each video to be played as a slideshow from the default () constructor. Each video is a maximum 20 seconds long so there will be alot of videos.
What I have learned so far from debugging is that there is a memory leak caused by the following:
VisualTargetPresentationSource instances are not being removed when video.Dispose() is called same goes for VlcEventManager (but the event manager occurs less).
VisualHost, VisualTarget and ScaleTransform are also piling up.
There is a VlcPlayer.cs file where EventManager.Detach is not being called on Dispose function.
I tried understanding the workings of the custom dispatcher with no luck but I believe the dispatcher is not properly removing the elements.
In the VlcPlayer constructor AddHandler is being called without RemoveHandler in Dispose() maybe that is also the problem.
I have tried as a workaround to use 2 fixed players in xaml but when I call: video.Stop(); video.LoadMedia("xxx"); video.Play(); playback freezes for around 5 seconds which is not good since some of the videos appear for only 1 second.
Now it's becoming funny :D
I did a workaround using 4 fixed players and I alternate between them, I managed to avoid the freezing by calling video.VlcMediaPlayer.play();
However, now after playing many videos (forced the pace at around 2.5 seconds per video) for around 15 minutes or so the application consumes around 1.5 gb and exists with memory full error.
There is a lot of memory leaks in this library, I wish I can help to solve them