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

This forum is about all development around libVLC.
avsuper
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2018 04:22

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

Postby avsuper » 05 Jan 2019 16:41

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!!!

avsuper
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2018 04:22

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

Postby avsuper » 05 Jan 2019 16:45

libvlc_media_player_stop really often causes deadlock.....OMG....

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 05 Jan 2019 21:43

The bug is not fixed because it is in some applications, not in LibVLC.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

avsuper
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2018 04:22

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

Postby avsuper » 06 Jan 2019 03:32

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!!!

avsuper
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2018 04:22

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

Postby avsuper » 06 Jan 2019 03:36

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');

avsuper
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2018 04:22

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

Postby avsuper » 06 Jan 2019 03:41

stop deaklock not occurs everytime, almost 1/20 maybe, randomly.
Use thread instead of timer has no use...

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 20 Jan 2019 22:35

RTSP can be long to close, be careful!
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

DarianAnjuhal
New Cone
New Cone
Posts: 2
Joined: 29 Jan 2019 13:35

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

Postby DarianAnjuhal » 29 Jan 2019 17:18

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 29 Jan 2019 22:18

It could be many things. Without a threaded symbolic trace, it is very unlikely that anybody can help you.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests