diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c index 33937d8221..4c7ea68df4 100644 --- a/libavfilter/af_sofalizer.c +++ b/libavfilter/af_sofalizer.c @@ -490,8 +490,15 @@ static int compensate_volume(AVFilterContext *ctx) av_log(ctx, AV_LOG_DEBUG, "Compensate-factor: %f\n", compensate); ir = sofa->data_ir; /* apply volume compensation to IRs */ - s->fdsp->vector_fmul_scalar(ir, ir, compensate, sofa->n_samples * sofa->m_dim * 2); - emms_c(); + if (sofa->n_samples & 31) { + int i; + for (i = 0; i < sofa->n_samples * sofa->m_dim * 2; i++) { + ir[i] = ir[i] * compensate; + } + } else { + s->fdsp->vector_fmul_scalar(ir, ir, compensate, sofa->n_samples * sofa->m_dim * 2); + emms_c(); + } } return 0;