[FFmpeg-devel] [PATCH] lavfi/volume: support all channel counts

Nicolas George george at nsup.org
Mon Dec 2 20:25:35 CET 2013


Le duodi 12 frimaire, an CCXXII, Stefano Sabatini a écrit :
> Updated, FATE passes here.
> -- 
> FFmpeg = Fundamentalist and Freak Magnificient Peaceless Exciting Gospel

> >From 9a9f41462ff547480ab3c650abbb9386c2642182 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Mon, 2 Dec 2013 19:44:09 +0100
> Subject: [PATCH] lavfi/volume: support all channel counts
> 
> ---
>  libavfilter/af_volume.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
> index cd24877..21fe9a1 100644
> --- a/libavfilter/af_volume.c
> +++ b/libavfilter/af_volume.c
> @@ -101,7 +101,7 @@ static int query_formats(AVFilterContext *ctx)
>          }
>      };
>  
> -    layouts = ff_all_channel_layouts();
> +    layouts = ff_all_channel_counts();
>      if (!layouts)
>          return AVERROR(ENOMEM);
>      ff_set_common_channel_layouts(ctx, layouts);
> @@ -206,7 +206,7 @@ static int config_output(AVFilterLink *outlink)
>      AVFilterLink *inlink = ctx->inputs[0];
>  
>      vol->sample_fmt = inlink->format;
> -    vol->channels   = av_get_channel_layout_nb_channels(inlink->channel_layout);
> +    vol->channels   = inlink->channels;
>      vol->planes     = av_sample_fmt_is_planar(inlink->format) ? vol->channels : 1;
>  
>      volume_init(vol);

It could completely drop vol->channels for link->channels, but that is not
important, and possibly it would make merging from the fork harder.

Looks good to me, thanks.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131202/fc6a7010/attachment.asc>


More information about the ffmpeg-devel mailing list