Page 1 of 1

libvlc: callbacks still received after player stop/release

Posted: 15 Oct 2014 15:44
by badgeror
Hi all
I'm having strange problems with a RTSP stream decoder that I'm building based on libvlc.
It uses callbacks (registered with libvlc_video_set_callbacks) to receive images and provide them to the application. This works fine thanks for the work guys btw.

The issue comes when deleting the decoder. I'm calling the following sequence
libvlc_media_player_stop(m_player);
libvlc_media_player_release(m_player); m_player = NULL;
libvlc_media_release(m_media); m_media = NULL;
followed by:
libvlc_release(sm_vlcInstance);

All works fine yet I'm still receiving calls to the callback methods after these calls. How is that possible? I'd expect player_stop to stop messaging and not receive any more callbacks calls afterwards. Am I'm missing something or is there some message buffering done in libvlc which is not cleared at stop?

Re: libvlc: callbacks still received after player stop/relea

Posted: 15 Oct 2014 15:49
by RĂ©mi Denis-Courmont
Normally, it can still occur during stop, but not after stop has returned.

Re: libvlc: callbacks still received after player stop/relea

Posted: 15 Oct 2014 16:09
by badgeror
Well that's the behavior I expected but even after libvlc_release I'm still getting some which cause my app to crash as the object used in the callbacks has been destroyed... I'm running with VLC 2.1.5 on a windows 8.1 64. code is compiled as 32 bits exe with VS2010

Re: libvlc: callbacks still received after player stop/relea

Posted: 20 Oct 2014 14:47
by badgeror
Ok I just found out the source of the issue:
I was opening the stream twice (second time through a non trivial code path) but kept track of the last opening only so I stopped only one of the streams...
Next time I should check my code first