Attaching to events in libvlc

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
jboileau
Blank Cone
Blank Cone
Posts: 17
Joined: 13 Dec 2005 21:05

Attaching to events in libvlc

Postby jboileau » 29 Nov 2007 17:19

Hi,

I am building a small application in C++ using libvlc.dll (libvlc_control.dll actually since I am using the 0.9.0 version from the trunk). Things are working pretty well and I have most of what I need completed. But I need to detect the end of whatever is playing. I have tried using the event manager and a callback without success. Here is how I do things when I start the play (I have removed all error checking code to make it concise):

Code: Select all

libvlc_playlist_add_extended(aLibvlcInstance, pFile, NULL, lNbVLCArgs, lVLCArgs, aLibvlcException); libvlc_playlist_play(aLibvlcInstance, 0, 0, NULL, aLibvlcException); lMediaInstance = libvlc_playlist_get_media_instance(aLibvlcInstance, aLibvlcException); lEventManager = libvlc_media_instance_event_manager(lMediaInstance, aLibvlcException); libvlc_event_attach(lEventManager, libvlc_MediaInstanceReachedEnd, mMediaInstanceReachedEnd, this, aLibvlcException);
My callback is declared as:

Code: Select all

static void mMediaInstanceReachedEnd( const libvlc_event_t * p_event, void * p_user_data );
But my callback mMediaInstanceReachedEnd never gets called. Anyone know why? I have tried to keep this post as compact as possible but if more info is needed let me know.

I would rather detect when the playlist finishes completly, not each file of the playlist, but there does not seem to be any API for that?

Jacques Boileau

Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 64 guests