libvlc_media_player_stop hang

This forum is about all development around libVLC.
heng
New Cone
New Cone
Posts: 7
Joined: 26 Feb 2010 08:09

libvlc_media_player_stop hang

Postby heng » 25 Nov 2010 09:04

Hi,
I am using libvlc to stream video over wifi. When wifi suddenly disconnects, if the VLC control still indicates that the video is still playing, I call "libvlc_media_player_stop".

Unfortunately, in this scenario calling "libvlc_media_player_is_playing" shows that the video still plays (although I can visually see that it's stuck) and the subsequent call to "libvlc_media_player_stop" hangs for ~30 seconds.

What exactly am I doing wrong?

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

Re: libvlc_media_player_stop hang

Postby Rémi Denis-Courmont » 25 Nov 2010 17:04

Nothing. is_playing indicates whether the media pipeline is playing, not whether there is any data.

As for the timeout, that depends on the protocol used. At least RTSP can be extremely slow in case of timeout.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

heng
New Cone
New Cone
Posts: 7
Joined: 26 Feb 2010 08:09

Re: libvlc_media_player_stop hang

Postby heng » 26 Nov 2010 07:29

Ok, I understand, thanks, but don't you think that in any case the "stop" command should return immediately and not lock the application for so long?

Do I really need to call "stop" in such cases? Is there any function I can use to quickly identify scenarios where the pipe no longer transfers data (and then maybe call "stop" in a sub-thread and not lock the application)?

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_media_player_stop hang

Postby Sébastien Escudier » 26 Nov 2010 08:17

Yes it should, but as Rémi told you it depends on the protocol.
Is it RTSP ? if yes vlc 1.2 should fix this blocking timeout on stop.

heng
New Cone
New Cone
Posts: 7
Joined: 26 Feb 2010 08:09

Re: libvlc_media_player_stop hang

Postby heng » 26 Nov 2010 13:39

Yes it's RTSP

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_media_player_stop hang

Postby Sébastien Escudier » 26 Nov 2010 13:45

try latest git version if you can, or a nightly build.

Rumpel
Blank Cone
Blank Cone
Posts: 16
Joined: 11 Feb 2011 08:18

Re: libvlc_media_player_stop hang

Postby Rumpel » 17 Mar 2011 15:10

And the result of the story?

jcsanchez
New Cone
New Cone
Posts: 6
Joined: 22 Mar 2012 16:02

Re: libvlc_media_player_stop hang

Postby jcsanchez » 22 Mar 2012 17:46

I have the same problem, in some machines VLC (or my application using libvlc) hang when I click STOP (or I send the stop command).

I'm using VLC 2.0.1

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

Re: libvlc_media_player_stop hang

Postby Rémi Denis-Courmont » 22 Mar 2012 18:24

live555 can get stuck when there is a network problem. I don't think that can be fixed in VLC, other than by ripping out live555 entirely in favor of a would-be native RTSP stack. And that is humonguous work.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_media_player_stop hang

Postby Sébastien Escudier » 22 Mar 2012 20:50

jcsanchez, is it with rtsp streams ?

jcsanchez
New Cone
New Cone
Posts: 6
Joined: 22 Mar 2012 16:02

Re: libvlc_media_player_stop hang

Postby jcsanchez » 24 Mar 2012 11:28

I fixed the problem installing Windows7 SP1.

Thanks for your help.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_media_player_stop hang

Postby Sébastien Escudier » 24 Mar 2012 16:40

To clarify this rtsp hang issue :
With vlc before 2.0 rtsp streams could hang for a long time when sending a teardown message.
This issue is fixed in vlc 2, but it stil can hang on rtsp connect.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests