[vlc-devel] [PATCH] access module for BlackMagic SDI cards

Rémi Duraffort ivoire at videolan.org
Mon Sep 27 15:05:34 CEST 2010


> > >> +    int i_card_index = var_CreateGetInteger( p_demux, "sdi-card-index" );
> > > Shouldn't you use inherit here?
> > 
> > Please explain (or point to an example). I have no idea how this stuff works :-)
> var_inheritInteger.
> Ivoire will comment more.
If I have to comment :)

If you use a vlc_variable (like when using var_*) only for the
configuration (seems to be the case here as you don't register any
callback on the variables), that's better to use var_Inherit* instead of
var_CreateGet*. In fact the second method will create the variable,
inherit the value from the configuration and return it. The first one
will just inherit the value from the configuration and return it.

That's a bit faster and uses a bit less memory. There is not a huge
difference but it doesn't cost anything.


Best regards

-- 
Rémi Duraffort | ivoire
http://ivoire.dinauz.org/blog/



More information about the vlc-devel mailing list