[vlc-devel] Why is Open method on a module called twice?

Peter Tap ptrtap at yahoo.com
Wed Aug 29 10:48:15 CEST 2012


Folks,

Here is my module definition:


    set_category( CAT_VIDEO )
    set_subcategory( SUBCAT_VIDEO_VFILTER )
    set_capability( "video filter2", 0 )
    set_callbacks( OpenVideo, Close )


What I noticed is that VLC calls OpenVideo method twice. Essentially, this results in creating two instances of my  module. 


I am wondering if anyone know why VLC does this?

What I also noticed is that VLC will shortly call Close on the first instance. The sequence is as follows:

Create instance 1.
Call Filter method on instance 1.
Close instance 1.
Create instance 2.
Keep calling Filter method on instance 2.
Close instance 2.


I load a bunch of images in my OpenVideo method. These images are now getting loaded twice. Although the first instance is subsequently released, I am wondering if there is any recommended practice (such as moving the initialization logic out of OpenVideo to Filter method).

Thank you in advance for your help.

Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120829/f185d736/attachment.html>


More information about the vlc-devel mailing list