From ee64b64c0227e0e7f231e7d07f4bb2964dd7015d Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 23 Dec 2018 21:40:07 +0100 Subject: [PATCH] avfilter/af_sofalizer: set delays when interpolation is disabled --- libavfilter/af_sofalizer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c index 7812e25557..c30f99c810 100644 --- a/libavfilter/af_sofalizer.c +++ b/libavfilter/af_sofalizer.c @@ -627,6 +627,13 @@ static int getfilter_float(AVFilterContext *ctx, float x, float y, float z, nearest, neighbors, s->sofa.fir, delays); } else { + if (s->sofa.hrtf->DataDelay.elements > s->sofa.hrtf->R) { + delays[0] = s->sofa.hrtf->DataDelay.values[nearest * s->sofa.hrtf->R]; + delays[1] = s->sofa.hrtf->DataDelay.values[nearest * s->sofa.hrtf->R + 1]; + } else { + delays[0] = s->sofa.hrtf->DataDelay.values[0]; + delays[1] = s->sofa.hrtf->DataDelay.values[1]; + } res = s->sofa.hrtf->DataIR.values + nearest * s->sofa.hrtf->N * s->sofa.hrtf->R; }