diff --git a/spa/plugins/audioconvert/channelmix-ops-c.c b/spa/plugins/audioconvert/channelmix-ops-c.c index 3d4284111..1a6ff6265 100644 --- a/spa/plugins/audioconvert/channelmix-ops-c.c +++ b/spa/plugins/audioconvert/channelmix-ops-c.c @@ -47,11 +47,11 @@ static inline void vol_c(float *d, const float *s, float vol, uint32_t n_samples } } -static inline void add_c(float *d, const float *s0, const float *s1, uint32_t n_samples) +static inline void avg_c(float *d, const float *s0, const float *s1, uint32_t n_samples) { uint32_t n; for (n = 0; n < n_samples; n++) - d[n] = s0[n] + s1[n]; + d[n] = (s0[n] + s1[n]) * 0.5f; } static inline void sub_c(float *d, const float *s0, const float *s1, uint32_t n_samples) @@ -211,14 +211,14 @@ channelmix_f32_2_3p1_c(struct channelmix *mix, void * SPA_RESTRICT dst[], if (mix->widen == 0.0f) { vol_c(d[0], s[0], v0, n_samples); vol_c(d[1], s[1], v1, n_samples); - add_c(d[2], s[0], s[1], n_samples); + avg_c(d[2], s[0], s[1], n_samples); } else { for (n = 0; n < n_samples; n++) { float c = s[0][n] + s[1][n]; float w = c * mix->widen; d[0][n] = (s[0][n] - w) * v0; d[1][n] = (s[1][n] - w) * v1; - d[2][n] = c; + d[2][n] = c * 0.5f; } } lr4_process(&mix->lr4[3], d[3], d[2], v3, n_samples);