Page 1 of 1

vlc got my program stuck

Posted: 21 Jul 2016 09:46
by 1234yess
Hello,

I am using vlc version 2.2.4 in vb.net (axvlcplugin2)
I making a small program that taking 4 videos and streaming them, the program replacing the videos every 30 second

I played the media via this code:

Code: Select all

Dim uri = New Uri("C:\Users\xxx\Desktop\der\60\checkVlcnews\The Boys.mp4") AxVLCPlugin21.playlist.add(uri.AbsoluteUri) AxVLCPlugin21.playlist.play()
And stop the media via this code:

Code: Select all

If (AxVLCPlugin21.playlist.isPlaying = True) Then AxVLCPlugin21.playlist.stop() End If AxVLCPlugin21.playlist.items.remove(0) AxVLCPlugin21.playlist.items.clear()
This is the code for all the vlc objects.

The problem is that after some time my program got stuck in the command: "AxVLCPlugin21.playlist.stop()" and it doesn't responding-and it cause a deadlock.
This problem can occur after a few hours (about 3 hours) ,I tried to reboot my computer and then it worked for about 23 hour but in the second run it worked as always (for about 4-3 hours)

I tried to find the cause for this problem –but I didn’t found any.
I searched in my windows resource and I found that the cpu is very high –about 80% ,can it be that the problem is because the cpu?

I hope you can help me and tell me if you know about this problem and what is the solution
Thanks in advance

Re: vlc got my program stuck

Posted: 21 Jul 2016 22:27
by da2424
No idea what is the exact cause, but yes, the high CPU usage could be a cause.
You could try to add the videos only once, afterwards you can switch through the playlist via AxVLCPlugin21.playlist.next() or AxVLCPlugin21.playlist.playItem(idx). Maybe this will be more performant.

Btw, if you use AxVLCPlugin21.playlist.items.clear(), you don't need AxVLCPlugin21.playlist.items.remove(0).

Re: vlc got my program stuck

Posted: 24 Jul 2016 07:06
by 1234yess
I know about the other way that you mention, but I cant use this way because I am letting the user to add medias to the vlc and to remove medias whenever he want (this is the point of my application).
Do you know what can I do about this problem if the problem is really the high CPU usage?

thank you for your help

Re: vlc got my program stuck

Posted: 24 Sep 2018 21:38
by scottgeigel
I know this is an old thread, but I'm having a similar problem in my C# application.

On a whim, I tried running the vlc operations that were getting stuck in a Task/Thread. It seems to have stopped.
Don't know if that'll help, and I have no clue why this seems to fix the problem.