[vlc-devel] libvlc_media_descriptor_... setting mrl question

jboileau jboileau at gmail.com
Thu Jan 24 15:04:22 CET 2008

Hi Pierre,

Well yes the problem is with the release of the media instance and it
probably make sense that it hangs there. But I don't know how to do things
diffrently. If I need to create a new media descriptor and then get a new
media instance from it, if I don't release the previous one won't I end up
with memory leaks? Here is what I do in my event callback. Any suggestions
on what to do differently for things to work?

I detach from the event manager (libvlc_event_detach)
I release the media instance (libvlc_media_instance_release)
--> and it hangs right here as expected <---
I create a new media descriptor (libvlc_media_descriptor_new)
I add options (libvlc_media_descriptor_add_option)
I create a media instance (libvlc_media_instance_new_from_media_descriptor)
I release the media descriptor (libvlc_media_descriptor_release)
I get the new event manager (libvlc_media_instance_event_manager)
I attach to it (libvlc_event_attach)
I start the play (libvlc_media_instance_play)

I hope this helps you figure things out. Let me know if you need more

As always: thanks for your help it is greatly appreciated!


On Jan 23, 2008 5:58 PM, Pierre d'Herbemont <pdherbemont at free.fr> wrote:

>  On Jan 23, 2008, at 10:48 PM, jboileau wrote:
> My reason to do that is to be able to start a new play from inside the libvlc_MediaInstanceReachedEnd
> event. I may not be doing things correctly but presently it simply hangs in
> my callback. Probably because I am trying to release something that is
> probably what is calling me back! :-) The media descriptor. I have
> circumvented the problem by posting myself a message (I am working under
> Windowzzzz) and this lets me do what I want since in the handler for this
> message I am out of the libvlc_MediaInstanceReachedEnd event callback. But I
> would rather not have to resort to this double callback scheme to get things
> working.
> This is a bit weird cause you shouldn't get issue when releasing the media
> descriptor in the media_instance callback, unless you are releasing the
> media instance that currently plays the media descriptor.
> Tell me if you encounters more trouble, I'll have a look over the weekend.
> Pierre.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080124/cc0e0a43/attachment.html>

More information about the vlc-devel mailing list