[vlc-devel] Re: Multiple instances of vlc have incorrect instance references

Tony Anecito adanecito at yahoo.com
Sun May 13 07:42:17 CEST 2007


Hi Filippo,
   
  I figured out the problem. The destroy method in JVLC.java will never work. The logic is wrong. I am not sure what was being attempted but being destroyed should be false.
   
  Again, not sure why the logic is this way.
   
  Regards,
  -Tony
   
  /**
  * Destroys the current instance of jvlc, cleaning up objects.
  * This is unreversible.
  */
  public void destroy() {
  beingDestroyed = true;
  if (!beingDestroyed)
  {
  _destroy();
  }
  }
  

Filippo Carone <filippo at carone.org> wrote:
  Tony Anecito ha scritto:
> ...

Hi Tony,
a workaround for avoiding the removal of the first libvlc instance,
could the use of addNotify() and removeNotify() methods, as Daniel
Kaufmann recently suggested to me. Java awt controls implement these 2
methods, which are invoked when the window peer is created (->
addNotify()) and removed (removeNotify()). A test I ask you to do could
do would be:

1. do not implement natively paint(), but leave the default implementation
2. override addNotify to run the current native code used for paint()
3. override removeNotify to destroy the libvlc instance

this could help avoiding the vout window to be created without a peer. 
The problem you exposed could be a missing delay time between the play() 
command and the peer creation. If the operating system has not created 
the peer window and you run play() on jvlc, it will happen vlc will 
spawn a new window.

> Now I run the same test but with only one child with the libvlc video
> step 7 above has matching libvlc instances so get the correct window
> handle back and the video plays int the canvas as expected.

That's normal.

> So I was curious where in the code the p_vout->p_libvlc is set since
> that is part of the key for the retrieval of the window handle from
> the var_Get( p_vout->p_libvlc, "drawable", &val ) function. The
> other part of the key for retrieval is the "drawable" string.
> 
> Does that help more?

Let me know your thoughts about the above suggestion,
cheers,
Filippo

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



 
---------------------------------
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070512/adb2979b/attachment.html>


More information about the vlc-devel mailing list