[vlc-devel] Deadlocked in stop if too close to play

Pierre d'Herbemont pdherbemont at free.fr
Tue Oct 27 12:48:04 CET 2009


On Mon, Oct 26, 2009 at 5:42 PM, jboileau <jboileau at gmail.com> wrote:
> Hi,
>
> I am using LibVLC in an application of my own under Win32. One problem
> I have never been able to fix is a deadlock in
> libvlc_media_player_stop if it is called too close to a
> libvlc_media_player_play. The application hangs and pausing the
> application in the development environment reveals that it is
> deadlocked in the stop.

Can you share with us a sample code that exhibit this bug?

> My application cycles through surveillance cameras using a timer, but
> on an emergency signal I must switch to a particular camera. As you
> may deduce: a play may have just been started when such a signal is
> received. Thus a stop may be very close to a play.
>
> I guess, to the limit, this code should work and not hang once in a while:
>
> libvlc_media_player_play(aLibVLCMediaPlayer, &lLibVLCException);
> libvlc_media_player_stop(aLibVLCMediaPlayer, &lLibVLCException);
>
> but it does at least 10% of the time for me. I have pasted below what
> little stack trace info I get from Visual Studio after the stop is
> called. What baffles me is that it seems to show that the stop calls
> libvlc_media_get_user_data. Looking at the VLC source code I could not
> find this. libvlc_media_player_stop does not seem to call
> libvlc_media_get_user_data!?!!?

The stack is then What version of libvlc/vlc are you using?

This could be three things:
- a bug in your program
- a bug in libvlc
- a bug in libvlccore

We have to clear this out. And the way to clear that is to show that
it is not in your program (ie - doing stuff in the handler
synchronously where libvlc doesn't support it well). For that the
sample test code would be great.

Pierre.



More information about the vlc-devel mailing list