Mutex problems when stopping libvlc

This forum is about all development around libVLC.
alb84
Blank Cone
Blank Cone
Posts: 29
Joined: 16 Dec 2009 15:40

Mutex problems when stopping libvlc

Postby alb84 » 19 Apr 2010 10:24

I am having some problems when stopping libvlc by clicking on a stop button...
I am using vmem output and lock and unlock callbacks which Wait and Release a Win32 Mutex but sometimes when I click on Stop the whole interface freezes...
What is the correct way to stop libvlc and handling the mutex correctly?

alb84
Blank Cone
Blank Cone
Posts: 29
Joined: 16 Dec 2009 15:40

Re: Mutex problems when stopping libvlc

Postby alb84 » 19 Apr 2010 12:37

Actually I commented the mutex and all the calls to CreateMutex, WaitForSingleObject, ReleaseMutex, and CloseHandle and run the code on a single core machine.
What I do is just call all the init stuff
...
m_vlcMediaplayer = libvlc_media_player_new( m_vlcInstance, &m_ex );
...
libvlc_media_player_play( m_vlcMediaplayer, &m_ex );

and the stop stuff
...
libvlc_media_player_stop( m_vlcMediaplayer, &m_ex );
...
libvlc_media_player_release( m_vlcMediaplayer );
...

I call no mutex stuff in the lock and unlock vmem callbacks.
Yet, even like this, sometimes the player is succesfully released, and sometimes not, and my gui freezes.

How the thread automatically created by libvlc works?
Is there an example to have an asynchronous stop work correctly?

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

Re: Mutex problems when stopping libvlc

Postby Rémi Denis-Courmont » 19 Apr 2010 19:21

There is a known bug in VLC versions < 1.1.0 whereby _stop can dead lock. This probably has nothing to do with your vmem callbacks. Please update to LibVLC 1.1.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

alb84
Blank Cone
Blank Cone
Posts: 29
Joined: 16 Dec 2009 15:40

Re: Mutex problems when stopping libvlc

Postby alb84 » 20 Apr 2010 10:40

Where I can get libVLC 1.1? The latest VLC client available for download is still 1.0 and I generated libvlc.lib from libvlc.dll as described here http://wiki.videolan.org/GenerateLibFromDll


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 2 guests