[FFmpeg-devel] [PATCH] lavfi: avfilter_merge_formats: handle case where inputs are same.

Stefano Sabatini stefano.sabatini-lala at poste.it
Thu Jun 9 11:37:18 CEST 2011


On date Thursday 2011-06-09 11:10:09 +0300, Mina Nagy Zaki encoded:
> ---
>  libavfilter/formats.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/libavfilter/formats.c b/libavfilter/formats.c
> index ec7fca3..58593fc 100644
> --- a/libavfilter/formats.c
> +++ b/libavfilter/formats.c
> @@ -44,6 +44,8 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, 
> AVFilterFormats *b)
>      AVFilterFormats *ret;
>      unsigned i, j, k = 0;
>  
> +    if (a == b) return a;
> +
>      ret = av_mallocz(sizeof(AVFilterFormats));
>  
>      /* merge list of formats */

Looks OK (I'd just add a note in the commit message that this is not
changing behavior, but just optimizing the case where the two merged
lists are the same one). I'll apply soon if I see no comments.
-- 
FFmpeg = Fanciful Fiendish Moronic Pitiful Enhanced Gem


More information about the ffmpeg-devel mailing list