[FFmpeg-devel] [PATCH] lavfi/avfiltergraph: always reduce all_layouts to a single layout

Nicolas George george at nsup.org
Mon Nov 21 13:07:37 EET 2016


Le primidi 1er frimaire, an CCXXV, Marton Balint a écrit :
> This reverts d300f5f6f570659e4b58567b35c9e8600c9f2956.
> 
> Further reference:
> https://ffmpeg.org/pipermail/ffmpeg-devel/2013-October/149935.html
> 
> I can't reproduce ticket #2899 so I am not sure the original patch is still
> needed. Reverting it fixes unknown channel layout support for trivial
> resamples, such as:
> 
> ffmpeg -f lavfi -i "aevalsrc=0|0|0|0|0|0|0|0|0:d=1,asetnsamples" -f null none
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavfilter/avfiltergraph.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index 3af698d..379bc1a 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -802,8 +802,7 @@ static int reduce_formats_on_filter(AVFilterContext *filter)
>              if (inlink->type != outlink->type || fmts->nb_channel_layouts == 1)
>                  continue;
>  
> -            if (fmts->all_layouts &&
> -                (!FF_LAYOUT2COUNT(fmt) || fmts->all_counts)) {
> +            if (fmts->all_layouts) {
>                  /* Turn the infinite list into a singleton */
>                  fmts->all_layouts = fmts->all_counts  = 0;
>                  if (ff_add_channel_layout(&outlink->in_channel_layouts, fmt) < 0)

This is not correct. It makes a difference if the condition you remove
is false, i.e. if !fmts->all_counts && FF_LAYOUT2COUNT(fmt): the filter
does not support unknown layouts, and you propose to give it one
nonetheless.

Regards,

-- 
  Nicolas George


More information about the ffmpeg-devel mailing list