[vlc-devel] [PATCH 1/2] Sepia video filter

Rémi Duraffort ivoire at videolan.org
Wed Nov 17 09:33:38 CET 2010


Hello,
This is really cool. Just two remarks.


> +static int FilterCallback ( vlc_object_t *p_this, char const *psz_var,
> +                            vlc_value_t oldval, vlc_value_t newval,
> +                            void *p_data )
> +{
> +    (void)oldval;    (void)p_data;
> +    filter_t *p_filter = (filter_t*)p_this;
> +    filter_sys_t *p_sys = p_filter->p_sys;
> +
> +    if( !strcmp( psz_var, CFG_PREFIX "intensity" ) )
> +    {
You don't need to check for psz_var to be CFG_PREFIX "intensity". You
registered only one callback so it will always be this variable.
Moreover if you remove this spurious strcmp you can use a spin_lock
which is way faster in this case.


> +        vlc_mutex_lock( &p_sys->lock );
> +        p_sys->i_intensity = newval.i_int;
> +        vlc_mutex_unlock( &p_sys->lock );

Anyway, thanks for your work.


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



More information about the vlc-devel mailing list