<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Jacques,<div><br class="webkit-block-placeholder"></div><div>Could you backtrace the running stuck process to see where in vlc it does hang?</div><div><br class="webkit-block-placeholder"></div><div>Pierre.</div><div><br><div><div>On Feb 1, 2008, at 2:17 PM, jboileau wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Pierre,</div> <div> </div> <div>Have you had a chance to look at this (see description below)? I can download and try the latest build, but wanted to know if anything changed before trying it out. Of course I never rule out that there isn't any problem and that I am just doing things wrong. In that eventuality, let me know if you have any idea on how differently I should do things, I would greatly appreciate. It is a bit problematic for me to not be able to start a new play from inside the media reached end callback.</div> <div> </div> <div>Thanks for your help,</div> <div> </div> <div>Jacques Boileau<br><br></div> <div class="gmail_quote">On Jan 24, 2008 4:14 PM, jboileau <<a href="mailto:jboileau@gmail.com">jboileau@gmail.com</a>> wrote:<br> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div>Hi Pierre,</div> <div> </div> <div>Unfortunatly my plan didn't work as well as I had hoped. Here is in a nutshell what I do in the callback now:</div> <div class="Ih2E3d"> <div> </div><font size="2"> <div>I create a new media descriptor (libvlc_media_descriptor_new)</div> <div>I add options (<font size="2">libvlc_media_descriptor_add_option)</font></div> <div></div></font></div>I set the descriptor (<font size="2">libvlc_media_instance_set_media_descriptor)</font> <div class="Ih2E3d"><br> <div><font size="2">I start the play (<font size="2">libvlc_media_instance_play)</font></font></div> <div> </div></div> <div>The rest I do once at start up:</div> <div class="Ih2E3d"> <div> </div> <div> <div>I create a media instance (<font size="2">libvlc_media_instance_new_from_media_descriptor)</font></div></div></div> <div> <div>I get the event manager (<font size="2">libvlc_media_instance_event_manager)</font></div> <div class="Ih2E3d"> <div>I attach to it (<font size="2">libvlc_event_attach)</font></div></div></div> <div> </div> <div>Now when I am in the event it hangs in the call to libvlc_media_instance_set_media_descriptor. This happens independently if I call from the event or if I post myself a message and do it there! Strange! In an attempt to figure things out I have added a call to <font size="2">libvlc_media_instance_stop prior to calling <font size="2">libvlc_media_instance_set_media_descriptor. This makes things work IF not called directly from the event, otherwise it hangs in libvlc_media_instance_stop. </font></font><br> </div> <div>Hopefully I have included enough details to help you out.</div> <div> </div> <div>Jacques Boileau</div> <div> <div></div> <div class="Wj3C7c"> <div> </div> <div> </div> <div class="gmail_quote">On Jan 24, 2008 1:32 PM, jboileau <<a href="mailto:jboileau@gmail.com" target="_blank">jboileau@gmail.com</a>> wrote:<br> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div>Hi Pierre,</div> <div> </div> <div>I just took a closer look at the API and I will try creating a media instance that will be used for the life of my application and use libvlc_media_instance_set_media_descriptor for each new file I play. That way I won't release the media instance from inside my event. This seems like a much better idea. I'll let you know how it turns out. </div> <div> </div> <div>Jacques<br><br></div> <div> <div></div> <div> <div class="gmail_quote">On Jan 24, 2008 9:04 AM, jboileau <<a href="mailto:jboileau@gmail.com" target="_blank">jboileau@gmail.com</a>> wrote:<br> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div>Hi Pierre,</div> <div> </div> <div>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? </div> <div> </div> <div>I detach from the event manager (libvlc_event_detach)</div> <div>I release the media instance (libvlc_media_instance_release)</div> <div>--> and it hangs right here as expected <---</div> <div>I create a new media descriptor (libvlc_media_descriptor_new)</div> <div>I add options (<font size="2">libvlc_media_descriptor_add_option)</font></div> <div>I create a media instance (<font size="2">libvlc_media_instance_new_from_media_descriptor)</font></div> <div>I release the media descriptor (<font size="2">libvlc_media_descriptor_release)</font></div> <div>I get the new event manager (<font size="2">libvlc_media_instance_event_manager)</font></div> <div>I attach to it (<font size="2">libvlc_event_attach)</font></div> <div><font size="2">I start the play (<font size="2">libvlc_media_instance_play)</font></font></div> <div> </div> <div>I hope this helps you figure things out. Let me know if you need more details.</div> <div> </div> <div>As always: thanks for your help it is greatly appreciated!</div> <div> </div> <div>Jacques<br><br></div> <div class="gmail_quote"> <div> <div></div> <div>On Jan 23, 2008 5:58 PM, Pierre d'Herbemont <<a href="mailto:pdherbemont@free.fr" target="_blank">pdherbemont@free.fr</a>> wrote:<br></div></div> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div> <div></div> <div> <div style="WORD-WRAP: break-word"> <div><br> <div> <div>On Jan 23, 2008, at 10:48 PM, jboileau wrote:</div><br> <blockquote type="cite">My reason to do that is to be able to start a new play from inside the <font size="2">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. </font><br> </blockquote></div><br></div> <div>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.</div> <div><br></div> <div>Tell me if you encounters more trouble, I'll have a look over the weekend.</div><font color="#888888"> <div><br></div> <div>Pierre.</div></font></div><br></div></div> <div>_______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel </a><br> <br></div></blockquote></div></blockquote></div><br><br clear="all"></div></div></blockquote></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Jacques Boileau _______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="http://mailman.videolan.org/listinfo/vlc-devel">http://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote></div><br></div></body></html>