[FFmpeg-devel] [PATCH 16/25] avfilter/af_headphone: Fix channel assignment

Paul B Mahol onemda at gmail.com
Wed Sep 9 04:24:29 EEST 2020


On Tue, Sep 08, 2020 at 11:18:47PM +0200, Andreas Rheinhardt wrote:
> The documentation of the map argument of the headphone filter states:
> 
> "Set mapping of input streams for convolution. The argument is a
> ’|’-separated list of channel names in order as they are given as
> additional stream inputs for filter."
> 
> Yet this has not been honoured at all. Instead for the kth given HRIR
> channel pair it was checked whether there was a kth mapping and if the
> channel position so given was present in the channel layout of the main
> input; if so, then the given HRIR channel pair was matched to the kth
> channel of the main input. It should actually have been matched to the
> channel given by the kth mapping. A consequence of the current algorithm
> is that if N additional HRIR channel pairs are given, a permutation of
> the first N entries of the mapping does not affect the output at all.
> 
> The old code might even set arrays belonging to streams that don't exist
> (i.e. whose index is >= the number of channels of the main input
> stream); these parts were not read lateron at all. The new code doesn't
> do this any longer and therefore the number of elements of some of the
> allocated arrays has been reduced (in case the number of mappings was
> bigger than the number of channels of the first input stream).
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavfilter/af_headphone.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 

should be fine if properly tested.


More information about the ffmpeg-devel mailing list