Page 1 of 1

How To Shutdown

Posted: 05 Dec 2008 09:46
by d3x0r
I'm using simple media players...

a unique inst, media_new, player_new_from_media, event_manager, media_release, player_play...

the event is libvlc_MediaPlayerEndReached

when I get the event, I add my structure which contains all the above references to a list to later be deleted, and mark the current time.

A timer event later fires, and checks the list of expired players. (I did this, because releasing within the callback event is bad).

the later event sequence is
player_stop, event_detach, player_release, libvlc_release, after which I will release the drawable that was passed as the vmem options to the instance.

the last libvlc_release hangs. I didn't see a release for the event manager.


Does the instance have to be released by exactly the same thread that created it? that will be tough, since the one that created it no longer exists.

Re: How To Shutdown

Posted: 06 Dec 2008 22:11
by d3x0r
I solved this by creating a thread that in turn created the player and surface, started playing, and goes to sleep until the event fires, wakes up and cleans up everything it created. Apparently releasing an instance from all but the creating thread locks in libvlc_release(inst);