[vlc-devel] [PATCH 1/7] opencv_wrapper: Port to video filter2

Edward Wang edward.c.wang at compdigitec.com
Fri Aug 10 04:02:21 CEST 2012


On 12-08-09 05:28 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le jeudi 9 août 2012 22:19:09 Edward Wang, vous avez écrit :
>> +    p_filter->p_sys->p_opencv->p_module = NULL;
> Useless.
OK.

>
>> +        p_filter->p_sys->p_opencv->p_module =
> Trivially missing error handling... Might crash.
OK.

>
>> +            module_need( p_filter->p_sys->p_opencv,
>> p_filter->p_sys->psz_inner_name, NULL, false );
> Arbitrary module capability is non-sense. Might crash.
Fixed to not use arbitrary module capability.

>
>> -    if( !p_sys->p_opencv->p_module )
>> +    if( !p_filter->p_sys->p_opencv->p_module )
>>       {
>> -        msg_Err( p_vout, "can't open internal opencv filter: %s",
>> p_vout->p_sys->psz_inner_name );
>> -        p_vout->p_sys->psz_inner_name = NULL;
>> -        vlc_object_release( p_sys->p_opencv );
>> -        p_sys->p_opencv = NULL;
>> -    }
>> +        msg_Err( p_filter, "can't open internal opencv filter: %s",
>> p_filter->p_sys->psz_inner_name );
>> +       p_filter->p_sys->psz_inner_name = NULL;
> Memory leak.
OK.

>
>> +        vlc_object_release( p_filter->p_sys->p_opencv );
>> +        p_filter->p_sys->p_opencv = NULL;
> Useless.
OK.

>
>> +            if (p_sys->p_cv_image[i])
>> +                cvReleaseImageHeader(&(p_sys->p_cv_image[i]));
>> +            p_sys->p_cv_image[i] = NULL;
> Should be in the if() statement too.
OK.

>
>> +    clock_t start = clock();
> Might easily overflow on 32-bits system.
OK, i'll use a 64-bit counter instead then.

Regards,
         Edward Wang



More information about the vlc-devel mailing list