diff --git a/spa/plugins/audioconvert/channelmix-ops-c.c b/spa/plugins/audioconvert/channelmix-ops-c.c index 4502fee82..e70f70d68 100644 --- a/spa/plugins/audioconvert/channelmix-ops-c.c +++ b/spa/plugins/audioconvert/channelmix-ops-c.c @@ -237,6 +237,7 @@ channelmix_f32_2_3p1_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRI const float **s = (const float **)src; const float v0 = mix->matrix[0][0]; const float v1 = mix->matrix[1][1]; + const float v2 = (mix->matrix[2][0] + mix->matrix[2][1]) * 0.5f; if (SPA_FLAG_IS_SET(mix->flags, CHANNELMIX_FLAG_ZERO)) { for (i = 0; i < n_dst; i++) @@ -246,7 +247,7 @@ channelmix_f32_2_3p1_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRI for (n = 0; n < n_samples; n++) { d[0][n] = s[0][n]; d[1][n] = s[1][n]; - d[2][n] = (s[0][n] + s[1][n]) * 0.5f; + d[2][n] = (s[0][n] + s[1][n]) * v2; d[3][n] = 0.0f; } } @@ -254,7 +255,7 @@ channelmix_f32_2_3p1_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRI for (n = 0; n < n_samples; n++) { d[0][n] = s[0][n] * v0; d[1][n] = s[1][n] * v1; - d[2][n] = (d[0][n] + d[1][n]) * 0.5f; + d[2][n] = (d[0][n] + d[1][n]) * v2; d[3][n] = 0.0f; } } @@ -270,6 +271,7 @@ channelmix_f32_2_5p1_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRI const float **s = (const float **)src; const float v0 = mix->matrix[0][0]; const float v1 = mix->matrix[1][1]; + const float v2 = (mix->matrix[2][0] + mix->matrix[2][1]) * 0.5f; const float v4 = mix->matrix[4][0]; const float v5 = mix->matrix[5][1]; @@ -281,7 +283,7 @@ channelmix_f32_2_5p1_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRI for (n = 0; n < n_samples; n++) { d[0][n] = d[4][n] = s[0][n]; d[1][n] = d[5][n] = s[1][n]; - d[2][n] = (s[0][n] + s[1][n]) * 0.5f; + d[2][n] = (s[0][n] + s[1][n]) * v2; d[3][n] = 0.0f; } } @@ -289,7 +291,7 @@ channelmix_f32_2_5p1_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRI for (n = 0; n < n_samples; n++) { d[0][n] = s[0][n] * v0; d[1][n] = s[1][n] * v1; - d[2][n] = (d[0][n] + d[1][n]) * 0.5f; + d[2][n] = (d[0][n] + d[1][n]) * v2; d[3][n] = 0.0f; d[4][n] = s[0][n] * v4; d[5][n] = s[1][n] * v5;