<div>Hi Filippo,</div>  <div> </div>  <div>Thanks for the suggestions. I already did one when I wrote the response you read.</div>  <div> </div>  <div>3. override removeNotify to destroy the libvlc instance.</div>  <div>Did that already in the code.<BR></div><FONT size=2>  <div align=left></FONT><B><FONT color=#7f0055 size=2>public</B></FONT><FONT size=2> </FONT><B><FONT color=#7f0055 size=2>void</B></FONT><FONT size=2> removeNotify() {</div>  <div align=left></FONT><B><FONT color=#7f0055 size=2>if</B></FONT><FONT size=2> (</FONT><FONT color=#0000c0 size=2>jvlc</FONT><FONT size=2> != </FONT><B><FONT color=#7f0055 size=2>null</B></FONT><FONT size=2>) {</div>  <div align=left></FONT><B><FONT color=#7f0055 size=2>if</B></FONT><FONT size=2> (</FONT><FONT color=#0000c0 size=2>jvlc</FONT><FONT size=2>.isInputPlaying()) {</div>  <div align=left></FONT><B><FONT color=#7f0055 size=2>try</B></FONT><FONT size=2> {</div>  <div align=left></FONT><FONT color=#0000c0
 size=2>jvlc</FONT><FONT size=2>.</FONT><FONT color=#0000c0 size=2>playlist</FONT><FONT size=2>.stop();</div>  <div align=left>} </FONT><B><FONT color=#7f0055 size=2>catch</B></FONT><FONT size=2> (Exception ex) {</div>  <div align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT size=2>.println(</FONT><FONT color=#2a00ff size=2>"JVLCCanvas.removeNotify exception:"</FONT><FONT size=2> + ex);</div>  <div align=left>}</div>  <div align=left>}</div>  <div align=left></FONT><FONT color=#0000c0 size=2>jvlc</FONT><FONT size=2>.destroy();</div>  <div align=left>}</div>  <div align=left></FONT><B><FONT color=#7f0055 size=2>super</B></FONT><FONT size=2>.removeNotify();</div>  <div align=left></FONT><FONT color=#0000c0 size=2>bRemovedPeer</FONT><FONT size=2>=</FONT><B><FONT color=#7f0055 size=2>true</B></FONT><FONT size=2>;</div>  <div align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT size=2>.println(</FONT><FONT color=#2a00ff
 size=2>"removeNotify() on "</FONT><FONT size=2>);</div>  <div align=left></FONT><FONT color=#3f7f5f size=2>///new Exception().printStackTrace(System.out);</div></FONT><FONT size=2>  <div>}</div>  <div></FONT> </div>  <div>1. & 2. Done.</div><FONT size=2>  <div align=left></FONT><B><FONT color=#7f0055 size=2>public</B></FONT><FONT size=2> </FONT><B><FONT color=#7f0055 size=2>void</B></FONT><FONT size=2> addNotify() {</div>  <div align=left></FONT><B><FONT color=#7f0055 size=2>super</B></FONT><FONT size=2>.addNotify();</div>  <div align=left>Graphics g = <STRIKE>getPeer</STRIKE>().getGraphics();</div>  <div align=left></FONT><FONT color=#0000c0 size=2>jvlc</FONT><FONT size=2>.</FONT><FONT color=#0000c0 size=2>video</FONT><FONT size=2>.paint(</FONT><B><FONT color=#7f0055 size=2>this</B></FONT><FONT size=2>, g);</div>  <div align=left>System.</FONT><I><FONT color=#0000c0 size=2>out</I></FONT><FONT size=2>.println(</FONT><FONT color=#2a00ff size=2>"addNotify() on
 "</FONT><FONT size=2>);</div>  <div>}</div></FONT>  <div> </div>  <div> </div>  <div>Thanks I just tried it and it does not work.</div>  <div> </div>  <div>What I need is the answer to my question:</div>  <div>> So I was curious where in the code the p_vout->p_libvlc is set since<BR>> that is part of the key for the retrieval of the window handle from<BR>> the var_Get( p_vout->p_libvlc, "drawable", &val ) function. The<BR>> other part of the key for retrieval is the "drawable" string.<BR></div>  <div>Answer that and I can find out about the mysterious extra instance and give you all feedback.</div>  <div> </div>  <div>I am still open to other suggestions.</div>  <div> </div>  <div>Regards,</div>  <div>-Tony<BR><BR><B><I>Filippo Carone <filippo@carone.org></I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Tony Anecito ha scritto:<BR>>
 ...<BR><BR>Hi Tony,<BR>a workaround for avoiding the removal of the first libvlc instance,<BR>could the use of addNotify() and removeNotify() methods, as Daniel<BR>Kaufmann recently suggested to me. Java awt controls implement these 2<BR>methods, which are invoked when the window peer is created (-><BR>addNotify()) and removed (removeNotify()). A test I ask you to do could<BR>do would be:<BR><BR>1. do not implement natively paint(), but leave the default implementation<BR>2. override addNotify to run the current native code used for paint()<BR>3. override removeNotify to destroy the libvlc instance<BR><BR>this could help avoiding the vout window to be created without a peer. <BR>The problem you exposed could be a missing delay time between the play() <BR>command and the peer creation. If the operating system has not created <BR>the peer window and you run play() on jvlc, it will happen vlc will <BR>spawn a new window.<BR><BR>> Now I run the same test but with only
 one child with the libvlc video<BR>> step 7 above has matching libvlc instances so get the correct window<BR>> handle back and the video plays int the canvas as expected.<BR><BR>That's normal.<BR><BR>> So I was curious where in the code the p_vout->p_libvlc is set since<BR>> that is part of the key for the retrieval of the window handle from<BR>> the var_Get( p_vout->p_libvlc, "drawable", &val ) function. The<BR>> other part of the key for retrieval is the "drawable" string.<BR>> <BR>> Does that help more?<BR><BR>Let me know your thoughts about the above suggestion,<BR>cheers,<BR>Filippo<BR><BR>-- <BR>This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/<BR>To unsubscribe, please read http://developers.videolan.org/lists.html<BR><BR></BLOCKQUOTE><BR><p>

      <hr size=1>Ahhh...imagining that irresistible "new car" smell?<br> Check out
<a href="http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-">new cars at Yahoo! Autos.</a>