Page 1 of 1

libvlc hangs

Posted: 17 Oct 2008 19:16
by davidhoyt
Try doing the following:
  • Subscribe to receive the end reached media player event.
  • Try calling libvlc_media_player_stop() from the callback.
It freezes on you.

I would think that it should do nothing and just return if it's already stopped. :?

Re: libvlc hangs

Posted: 18 Oct 2008 14:03
by nicopam
Perhaps this has to do with this post of mine, describing a lock in stop and play?

Re: libvlc hangs

Posted: 20 Oct 2008 18:04
by davidhoyt
That sounds very much like my problem. I tried to call it on a separate thread as well but it still locks up. I'm running it in Java. This is a major show stopper for us. I've gone as far as rewriting the entire Java binding as a result. To get around it, I suppose you could comment out where it acquires the lock and then where it releases the lock and recompile. Not the correct solution, but without more intimate knowledge of VLC internals and the time to obtain that knowledge, it's the best we can do.

This is a major problem if you can't start/stop/start/stop the same libvlc instance. Now if we're using the library incorrectly, please let us know.

Thanks!

Re: libvlc hangs

Posted: 20 Oct 2008 18:06
by davidhoyt
I mentioned this problem in another thread as well (I didn't realize they were related): viewtopic.php?f=2&t=51184

Re: libvlc hangs

Posted: 22 Oct 2008 21:35
by davidhoyt
Try creating an app that has at least 12 videos playing simultaneously. If you stop and then play, it'll lock up after about 4-5 videos.

Re: libvlc hangs

Posted: 27 Oct 2008 18:16
by topolittle
Try doing the following:

Subscribe to receive the end reached media player event.
Try calling libvlc_media_player_stop() from the callback.
It freezes on you.
davidhoyt,

How do you subscribe to receive the event ?

I need to find a way to register a callback method to receive the MediaPlayerEndReached event.
Are you using then libvlc_event_attach method of libvlc ?

Re: libvlc hangs

Posted: 27 Oct 2008 22:34
by davidhoyt
When I'm getting ready to play something, I stop any previous media player object I have lying around, call libvlc_event_detach(), and then release it.

I then create a new media player object and then essentially call libvlc_event_attach() and then call play().

Re: libvlc hangs

Posted: 01 Apr 2009 14:53
by tihctw
Hi,
Does anyone get this fixed? or have the solution for it? I have faced the same problem ( calling libvlc_media_player_stop() freezed me ) with both the Marx and VideoLan.Interop wrappers for C#. If anyone has the solution for this, please advise! Thanks a lot!

Tihctw

Re: libvlc hangs

Posted: 01 Apr 2009 15:33
by Beardless2
have you tried using v1.0.0 GIT? this works much better for me, although i still occasionally get a lock with 4+ media players attempting to stop at the same time

Re: libvlc hangs

Posted: 02 Apr 2009 04:46
by tihctw
have you tried using v1.0.0 GIT? this works much better for me, although i still occasionally get a lock with 4+ media players attempting to stop at the same time
Well, I'm working on v0.9.8a, not v1.0.0. But even with v1.0.0, you still get locked occasionally, then this is not the final solution. I'm curious why v0.8.6x didn't have this kinda problem.
By the way, do you know how to get the debugging messages that the libvlc.dll/libvlccore.dll printed out with the wrapper/API? (I saw some libvlc_log_xxx APIs, but don't know how to use it)
Thanks!

tihctw

Re: libvlc hangs

Posted: 02 Apr 2009 07:29
by Beardless2
well 0.9.x has many new features.....but i guess at the same time a few bugs crept in. Ive not hooked into the log messages myself, but you are correct in saying it is the libvlc_log_xxx functions in the api you need to use. I wouldn't have thought the way in which you use them is too different from the other libvlc methods?

Re: libvlc hangs

Posted: 26 May 2010 12:18
by cobweb2304
Hi all,
I have the same problem, but i solved it.
In event callback, I set a boolean variable and after callback finished, i call libvlc_media_player_stop function.
Before callback finished, libvlc_media_player_stop behaves strangely, probably because of thread issues.
Now, there is not any freeze problem.
I hope this post can give you an idea.

Re: libvlc hangs

Posted: 26 May 2010 18:58
by RĂ©mi Denis-Courmont
the ..._stop deadlock is a well known bug in Libvlc <= 1.0. It was fixed months ago in the Libvlc 1.1 branch.