diff mbox

[FFmpeg-devel] avfilter/af_volumedetect: Remove dependency on channel layout

Message ID 20160905194231.21494-1-michael@niedermayer.cc
State Accepted
Headers show

Commit Message

Michael Niedermayer Sept. 5, 2016, 7:42 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/af_volumedetect.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Nicolas George Sept. 10, 2016, 9:21 a.m. UTC | #1
Le decadi 20 fructidor, an CCXXIV, Michael Niedermayer a écrit :
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/af_volumedetect.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

LGTM, thanks.

Note that to allow the filter to work with unknown layouts, they must be
declared as supported:

	ff_set_common_channel_layouts(ctx, ff_all_channel_counts());

(No time to properly do it and submit right now.)

Regards,
Michael Niedermayer Nov. 6, 2016, 4:03 p.m. UTC | #2
On Sat, Sep 10, 2016 at 11:21:28AM +0200, Nicolas George wrote:
> Le decadi 20 fructidor, an CCXXIV, Michael Niedermayer a écrit :
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavfilter/af_volumedetect.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> LGTM, thanks.
> 
> Note that to allow the filter to work with unknown layouts, they must be
> declared as supported:
> 
> 	ff_set_common_channel_layouts(ctx, ff_all_channel_counts());

changed

applied

thx

[...]
diff mbox

Patch

diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c
index 4815bcc..c6a6dba 100644
--- a/libavfilter/af_volumedetect.c
+++ b/libavfilter/af_volumedetect.c
@@ -51,9 +51,8 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *samples)
 {
     AVFilterContext *ctx = inlink->dst;
     VolDetectContext *vd = ctx->priv;
-    int64_t layout  = samples->channel_layout;
     int nb_samples  = samples->nb_samples;
-    int nb_channels = av_get_channel_layout_nb_channels(layout);
+    int nb_channels = av_frame_get_channels(samples);
     int nb_planes   = nb_channels;
     int plane, i;
     int16_t *pcm;