libvlc hangs

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
davidhoyt
Blank Cone
Blank Cone
Posts: 68
Joined: 02 May 2008 03:26

libvlc hangs

Postby davidhoyt » 17 Oct 2008 19:16

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. :?

nicopam
New Cone
New Cone
Posts: 3
Joined: 18 Oct 2008 10:46

Re: libvlc hangs

Postby nicopam » 18 Oct 2008 14:03

Perhaps this has to do with this post of mine, describing a lock in stop and play?

davidhoyt
Blank Cone
Blank Cone
Posts: 68
Joined: 02 May 2008 03:26

Re: libvlc hangs

Postby davidhoyt » 20 Oct 2008 18:04

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!

davidhoyt
Blank Cone
Blank Cone
Posts: 68
Joined: 02 May 2008 03:26

Re: libvlc hangs

Postby davidhoyt » 20 Oct 2008 18:06

I mentioned this problem in another thread as well (I didn't realize they were related): viewtopic.php?f=2&t=51184

davidhoyt
Blank Cone
Blank Cone
Posts: 68
Joined: 02 May 2008 03:26

Re: libvlc hangs

Postby davidhoyt » 22 Oct 2008 21:35

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.

topolittle
New Cone
New Cone
Posts: 4
Joined: 19 Oct 2008 15:34

Re: libvlc hangs

Postby topolittle » 27 Oct 2008 18:16

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 ?

davidhoyt
Blank Cone
Blank Cone
Posts: 68
Joined: 02 May 2008 03:26

Re: libvlc hangs

Postby davidhoyt » 27 Oct 2008 22:34

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().

tihctw
Blank Cone
Blank Cone
Posts: 19
Joined: 20 Aug 2008 08:32

Re: libvlc hangs

Postby tihctw » 01 Apr 2009 14:53

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

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: libvlc hangs

Postby Beardless2 » 01 Apr 2009 15:33

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

tihctw
Blank Cone
Blank Cone
Posts: 19
Joined: 20 Aug 2008 08:32

Re: libvlc hangs

Postby tihctw » 02 Apr 2009 04:46

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

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: libvlc hangs

Postby Beardless2 » 02 Apr 2009 07:29

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?

cobweb2304
New Cone
New Cone
Posts: 5
Joined: 30 Apr 2010 10:08

Re: libvlc hangs

Postby cobweb2304 » 26 May 2010 12:18

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.

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

Re: libvlc hangs

Postby Rémi Denis-Courmont » 26 May 2010 18:58

the ..._stop deadlock is a well known bug in Libvlc <= 1.0. It was fixed months ago in the Libvlc 1.1 branch.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 10 guests