Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am writing a program in vb.net
In my program I need to do that videos in a certain folder will appear one after the other.
In order to do that i am using vlc version 1.1.1.1 with vlcControl object
, everything work fine but after some hours the program is stuck-it is not responding

The line where it is stuck is :
C#
MoviOfSlidePicMovi1.Media = VlcMedia


In order to solve it I tried to release the memory via these Sentences:
C#
 Public MoviOfSlidePicMovi1 As VlcControl
Public VlcMedia As Vlc.DotNet.Core.Medias.PathMedia
 If (MoviOfSlidePicMovi0.Media IsNot Nothing) Then
   MoviOfSlidePicMovi0.Media.Dispose()
  MoviOfSlidePicMovi0.Media = Nothing
 End If
  If (VlcMedia IsNot Nothing) Then
      VlcMedia.Dispose()
       VlcMedia = Nothing
 End If
  VlcMedia = New Vlc.DotNet.Core.Medias.PathMedia(str)
  MoviOfSlidePicMovi0.Media = VlcMedia


when it didn't worked, I tried the same sentences without the dispose sentence:

C#
 Public MoviOfSlidePicMovi1 As VlcControl
Public VlcMedia As Vlc.DotNet.Core.Medias.PathMedia
 If (MoviOfSlidePicMovi0.Media IsNot Nothing) Then
  MoviOfSlidePicMovi0.Media = Nothing
 End If
  If (VlcMedia IsNot Nothing) Then
       VlcMedia = Nothing
 End If
  VlcMedia = New Vlc.DotNet.Core.Medias.PathMedia(str)
  MoviOfSlidePicMovi0.Media = VlcMedia


the program worked better ,but still after few hours it was stuck

NOTE:
I am using the same object to show all the videos-it mean I am using one vlc player ,I open one video and when I want to replace it I am changing just the media property

How can I make it work without causing the program to be stuck after some time ???

Please help me it very urgent to me

thanks a lot

What I have tried:

I tried to release the memory- in the way that I wrote in the body of the question
but it didn't solve my problem
Posted
Updated 19-Jun-16 13:53pm

1 solution

You should run such stuff on a different Thread, then your App wont hang.
Make sure you dispose the instances that are not used anymore.
Also try to clean the %TEMP% folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900