[FFmpeg-soc] [soc]: r4726 - afilters/formats.c

Benoit Fouet benoit.fouet at free.fr
Thu Jul 16 22:50:33 CEST 2009


kdub wrote :
> Author: kdub
> Date: Thu Jul 16 16:36:49 2009
> New Revision: 4726
>
> Log:
> add audio avfilterformat initialization function
>
> Modified:
>    afilters/formats.c
>
> Modified: afilters/formats.c
> ==============================================================================
> --- afilters/formats.c	Thu Jul 16 11:51:29 2009	(r4725)
> +++ afilters/formats.c	Thu Jul 16 16:36:49 2009	(r4726)
> @@ -87,6 +87,19 @@ AVFilterFormats *avfilter_make_format_li
>      return ret;
>  }
>  
> +AVFilterFormats *avfilter_all_sampleformats()
>   

(void)

> +{
> +    AVFilterFormats *ret;
> +    int i;
> +    ret = av_mallocz(sizeof(AVFilterFormats));
>   

sizeof(*ret), and this can be merged with declaration

> +    ret->formats = av_malloc(sizeof(*ret->formats) * SAMPLE_FMT_NB);
> +
>   

also, I think you could check the malloc return values

> +    for (i = 0; i < SAMPLE_FMT_NB; i++ )
>   

nit: i++)

> +        ret->formats[i] = i;
> +
> +    return ret;
> +}
> +
>   

Ben



More information about the FFmpeg-soc mailing list