avfilter/af_headphone: fix type=time with hrir=multich
authorPaul B Mahol <onemda@gmail.com>
Mon, 16 Apr 2018 07:31:11 +0000 (09:31 +0200)
committerPaul B Mahol <onemda@gmail.com>
Mon, 16 Apr 2018 07:31:11 +0000 (09:31 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/af_headphone.c

index a71ed33..7910132 100644 (file)
@@ -567,8 +567,8 @@ static int convert_coeffs(AVFilterContext *ctx, AVFilterLink *inlink)
                 if (s->type == TIME_DOMAIN) {
                     offset = idx * FFALIGN(len, 16);
                     for (j = 0; j < len; j++) {
-                        data_ir_l[offset + j] = ptr[len * 2 - j * 2 - 2] * gain_lin;
-                        data_ir_r[offset + j] = ptr[len * 2 - j * 2 - 1] * gain_lin;
+                        data_ir_l[offset + j] = ptr[len * N - j * N - N + I    ] * gain_lin;
+                        data_ir_r[offset + j] = ptr[len * N - j * N - N + I + 1] * gain_lin;
                     }
                 } else {
                     memset(fft_in_l, 0, n_fft * sizeof(*fft_in_l));