Page 1 of 1

WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 05 Jan 2019 16:41
by avsuper
It has been years since we found the problem of calling libvlc_media_player_stop.
This function uses WaitForSingleObject with a parameter of INFINITE which can cause hang up of program.
We have tried many methods including calling it from thread,destroying window before stop, but no method can work perfectly...
Anybody knows how to totally solve this problem? Thanks in advance!!!

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 05 Jan 2019 16:45
by avsuper
libvlc_media_player_stop really often causes deadlock.....OMG....

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 05 Jan 2019 21:43
by Rémi Denis-Courmont
The bug is not fixed because it is in some applications, not in LibVLC.

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 06 Jan 2019 03:32
by avsuper
Hi, Rémi, thanks for reply!
You mean the deadlock is because application? But we have tried many methods, even if the application has only several lines of code, the deadlock still exists...
For example, I used a timer to call libvlc_media_player_stop and then call libvlc_media_player_play to play another media, the application ofter hangs up at "stop", especially if I switch between this application and other applications. And I have also tried to use thread instead of timer to call stop/play, no other codes at all, this problem occur also. Maybe every 10 to 20 times of call will cause a deaklock. I really don't know how to modify the application.
I have searched this forum using keyword "libvlc_media_player_stop" and can see several post about this problem but it seemed no one solved it totally...
Please give a help about how to avoid the deadlock.Thanks a lot!!!

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 06 Jan 2019 03:36
by avsuper
My code:

Code: Select all

procedure TForm1.Timer1Timer(Sender: TObject); var s: string; begin s := 'rtsp://192.168.0.100'; //stop Memo1.Lines.Add(TimeToStr(Now) + ' stop'); if (p_mi[index] <> NIL) then begin libvlc_media_player_stop(p_mi[index]); end; Memo1.Lines.Add(TimeToStr(Now) + ' stop OK'); //play Memo1.Lines.Add(TimeToStr(Now) + ' play'); p_md := libvlc_media_new_location(p_li, PAnsiChar(s)); if (p_md <> NIL) then begin libvlc_media_player_set_media(p_mi, p_md); libvlc_media_player_set_display_window(p_mi, Panel1.Handle); libvlc_media_player_play(p_mi); libvlc_media_release(p_md); end; Memo1.Lines.Add(TimeToStr(Now) + ' play OK');

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 06 Jan 2019 03:41
by avsuper
stop deaklock not occurs everytime, almost 1/20 maybe, randomly.
Use thread instead of timer has no use...

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 20 Jan 2019 22:35
by Jean-Baptiste Kempf
RTSP can be long to close, be careful!

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 29 Jan 2019 17:18
by DarianAnjuhal
Hi!

We have the same issue using qt in combination with vlc. We are using two QWidgets with two different videos running
vlc version: 3.0.4
qt version: 5.9.5

Do you have hints/ideas already?
Could the new vlc 4.0.0 release help? (Should we give it a try or is it wasted energy?)
Do you have working examples?

Thx anyway and have a nice day
Darian

Re: WHY? WHY? Why nobody can solve the problem of libvlc_media_player_stop hang up problem?

Posted: 29 Jan 2019 22:18
by Rémi Denis-Courmont
It could be many things. Without a threaded symbolic trace, it is very unlikely that anybody can help you.