[vlc-devel] [PATCH v2 2/2] mmal: Add deinterlace filter

Jean-Baptiste Kempf jb at videolan.org
Wed Sep 3 02:01:54 CEST 2014


On 02 Sep, Julian Scheel wrote :
> +    int i;
> +
> +    memset(&picture_res, 0, sizeof(picture_resource_t));
> +    sys->pictures = calloc(sys->output->buffer_num, sizeof(picture_t *));

Unchecked calloc

> +    for (i = 0; i < sys->output->buffer_num; i++) {

We're still C99 :)

> +        picture_res.p_sys = calloc(1, sizeof(picture_sys_t));

Unchecked calloc

> +static int Open(filter_t *filter)
> +{
> +    int32_t frame_duration = 1000000 /
> +        ((double)filter->fmt_in.video.i_frame_rate /
> +        filter->fmt_in.video.i_frame_rate_base);

Do you need the double here?
Why not, 1000000 * filter->fmt_in.video.i_frame_rate_base /
filter->fmt_in.video.i_frame_rate ?

> +    /*
> +     * Do not deinterlace if framerate is > 30fps. This is unlikely to work
> +     * well in any case.
> +     */

Are you sure that's a good idea?

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list