Page 1 of 1

libvlc_media_player_stop hang

Posted: 25 Nov 2010 09:04
by heng
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?

Re: libvlc_media_player_stop hang

Posted: 25 Nov 2010 17:04
by Rémi Denis-Courmont
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.

Re: libvlc_media_player_stop hang

Posted: 26 Nov 2010 07:29
by heng
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)?

Re: libvlc_media_player_stop hang

Posted: 26 Nov 2010 08:17
by Sébastien Escudier
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.

Re: libvlc_media_player_stop hang

Posted: 26 Nov 2010 13:39
by heng
Yes it's RTSP

Re: libvlc_media_player_stop hang

Posted: 26 Nov 2010 13:45
by Sébastien Escudier
try latest git version if you can, or a nightly build.

Re: libvlc_media_player_stop hang

Posted: 17 Mar 2011 15:10
by Rumpel
And the result of the story?

Re: libvlc_media_player_stop hang

Posted: 22 Mar 2012 17:46
by jcsanchez
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

Re: libvlc_media_player_stop hang

Posted: 22 Mar 2012 18:24
by Rémi Denis-Courmont
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.

Re: libvlc_media_player_stop hang

Posted: 22 Mar 2012 20:50
by Sébastien Escudier
jcsanchez, is it with rtsp streams ?

Re: libvlc_media_player_stop hang

Posted: 24 Mar 2012 11:28
by jcsanchez
I fixed the problem installing Windows7 SP1.

Thanks for your help.

Re: libvlc_media_player_stop hang

Posted: 24 Mar 2012 16:40
by Sébastien Escudier
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.