diff --git a/spa/plugins/audiomixer/mix-ops-avx.c b/spa/plugins/audiomixer/mix-ops-avx.c index d6b3dca5d..2ba1db85e 100644 --- a/spa/plugins/audiomixer/mix-ops-avx.c +++ b/spa/plugins/audiomixer/mix-ops-avx.c @@ -124,12 +124,12 @@ mix_f32_avx(struct mix_ops *ops, void * SPA_RESTRICT dst, const void * SPA_RESTR uint32_t i; if (n_src == 0) - memset(dst, 0, n_samples * sizeof(float)); + memset(dst, 0, n_samples * ops->n_channels * sizeof(float)); else if (dst != src[0]) - memcpy(dst, src[0], n_samples * sizeof(float)); + memcpy(dst, src[0], n_samples * ops->n_channels * sizeof(float)); for (i = 1; i + 2 < n_src; i += 3) mix_4(dst, src[i], src[i + 1], src[i + 2], n_samples); for (; i < n_src; i++) - mix_2(dst, src[i], n_samples); + mix_2(dst, src[i], n_samples * ops->n_channels); } diff --git a/spa/plugins/audiomixer/mix-ops-sse.c b/spa/plugins/audiomixer/mix-ops-sse.c index 5db17605e..6e2b32465 100644 --- a/spa/plugins/audiomixer/mix-ops-sse.c +++ b/spa/plugins/audiomixer/mix-ops-sse.c @@ -79,11 +79,11 @@ mix_f32_sse(struct mix_ops *ops, void * SPA_RESTRICT dst, const void * SPA_RESTR uint32_t i; if (n_src == 0) - memset(dst, 0, n_samples * sizeof(float)); + memset(dst, 0, n_samples * ops->n_channels * sizeof(float)); else if (dst != src[0]) - memcpy(dst, src[0], n_samples * sizeof(float)); + memcpy(dst, src[0], n_samples * ops->n_channels * sizeof(float)); for (i = 1; i < n_src; i++) { - mix_2(dst, src[i], n_samples); + mix_2(dst, src[i], n_samples * ops->n_channels); } } diff --git a/spa/plugins/audiomixer/mix-ops-sse2.c b/spa/plugins/audiomixer/mix-ops-sse2.c index d24ddd093..0d76eb17d 100644 --- a/spa/plugins/audiomixer/mix-ops-sse2.c +++ b/spa/plugins/audiomixer/mix-ops-sse2.c @@ -79,11 +79,11 @@ mix_f64_sse2(struct mix_ops *ops, void * SPA_RESTRICT dst, const void * SPA_REST uint32_t i; if (n_src == 0) - memset(dst, 0, n_samples * sizeof(double)); + memset(dst, 0, n_samples * ops->n_channels * sizeof(double)); else if (dst != src[0]) - memcpy(dst, src[0], n_samples * sizeof(double)); + memcpy(dst, src[0], n_samples * ops->n_channels * sizeof(double)); for (i = 1; i < n_src; i++) { - mix_2(dst, src[i], n_samples); + mix_2(dst, src[i], n_samples * ops->n_channels); } } diff --git a/spa/plugins/audiomixer/mix-ops.c b/spa/plugins/audiomixer/mix-ops.c index f5fc697ec..816f44d1e 100644 --- a/spa/plugins/audiomixer/mix-ops.c +++ b/spa/plugins/audiomixer/mix-ops.c @@ -47,20 +47,20 @@ static struct mix_info mix_table[] = { /* f32 */ #if defined(HAVE_AVX) - { SPA_AUDIO_FORMAT_F32, 1, SPA_CPU_FLAG_AVX, 4, mix_f32_avx }, - { SPA_AUDIO_FORMAT_F32P, 1, SPA_CPU_FLAG_AVX, 4, mix_f32_avx }, + { SPA_AUDIO_FORMAT_F32, 0, SPA_CPU_FLAG_AVX, 4, mix_f32_avx }, + { SPA_AUDIO_FORMAT_F32P, 0, SPA_CPU_FLAG_AVX, 4, mix_f32_avx }, #endif #if defined (HAVE_SSE) - { SPA_AUDIO_FORMAT_F32, 1, SPA_CPU_FLAG_SSE, 4, mix_f32_sse }, - { SPA_AUDIO_FORMAT_F32P, 1, SPA_CPU_FLAG_SSE, 4, mix_f32_sse }, + { SPA_AUDIO_FORMAT_F32, 0, SPA_CPU_FLAG_SSE, 4, mix_f32_sse }, + { SPA_AUDIO_FORMAT_F32P, 0, SPA_CPU_FLAG_SSE, 4, mix_f32_sse }, #endif { SPA_AUDIO_FORMAT_F32, 0, 0, 4, mix_f32_c }, { SPA_AUDIO_FORMAT_F32P, 0, 0, 4, mix_f32_c }, /* f64 */ #if defined (HAVE_SSE2) - { SPA_AUDIO_FORMAT_F64, 1, SPA_CPU_FLAG_SSE2, 8, mix_f64_sse2 }, - { SPA_AUDIO_FORMAT_F64P, 1, SPA_CPU_FLAG_SSE2, 8, mix_f64_sse2 }, + { SPA_AUDIO_FORMAT_F64, 0, SPA_CPU_FLAG_SSE2, 8, mix_f64_sse2 }, + { SPA_AUDIO_FORMAT_F64P, 0, SPA_CPU_FLAG_SSE2, 8, mix_f64_sse2 }, #endif { SPA_AUDIO_FORMAT_F64, 0, 0, 8, mix_f64_c }, { SPA_AUDIO_FORMAT_F64P, 0, 0, 8, mix_f64_c },