[vlc-devel] Re: Multiple instances of vlc have incorrect instance references (vlc on windows unstable?)

Tony Anecito adanecito at yahoo.com
Sun May 13 10:26:26 CEST 2007

Hi Ahmad,
  Thanks for the advice but I am using a sun jvm (1.6). I will try to debug as far as I can but the problem is the jre dies so I can not get to far into the issue. I am hoping this is a simple issue that the jvlc or vlc group can explain and fix otherwise I will have to give up on jvlc/vlc. It is beta but I have spent weeks getting this far into trying to get java to work and I expect no matter what jvm is used it will crash.
  I appreciate the advice but this is up to the jvlc/vlc team.

Ahmad Hamadallah <ahmdprog at gmail.com> wrote:
        v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}                Hi Tony,
  Try to use Sun JVM, I faced many problems with debugging other than Sun JVM.
  Try to use Sun JVM and netbeans, you will stay in safe side of debagging and running application.
  I am not saying that it will solve your current problem, but at least, you are in safe side while using Sun JVM.
  Good luck.
    From: vlc-devel-bounce at videolan.org [mailto:vlc-devel-bounce at videolan.org] On Behalf Of Tony Anecito
Sent: Sunday, May 13, 2007 10:08 AM
To: vlc-devel at videolan.org
Cc: filippo at carone.org
Subject: [vlc-devel] Re: Multiple instances of vlc have incorrect instance references (vlc on windows unstable?)

    Hi Filippo,


    When I correct the logic the destroy method kills the running application. I used my debugger (Eclipse) and right when the destroy method is called the application or in this case jre crashes. On the other hand if not fixed there is a fairly big memory leak because I found out the instance of libvlc stays in memory if destory is never called as indicated in the method I pasted in previous email.


    Lets try to figure this out quickly I hate to see such unstable code in a project.




Tony Anecito <adanecito at yahoo.com> wrote:

      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.






    * Destroys the current instance of jvlc, cleaning up objects.

    * This is unreversible.


    public void destroy() {

    beingDestroyed = true;

    if (!beingDestroyed)






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,

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.

  Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.

Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070513/acb7ac95/attachment.html>

More information about the vlc-devel mailing list