filter-chain: fix gain when mixing 1 source

The gain was not used when mixing just one source.
This commit is contained in:
Wim Taymans 2023-09-27 16:10:56 +02:00
parent c4944dad17
commit ee8cb6aa67
2 changed files with 1 additions and 4 deletions

View file

@ -63,9 +63,6 @@ void dsp_mix_gain_c(struct dsp_ops *ops,
uint32_t i;
if (n_src == 0) {
dsp_clear_c(ops, dst, n_samples);
} else if (n_src == 1) {
if (dst != src[0])
dsp_copy_c(ops, dst, src[0], n_samples);
} else {
if (gain[0] == 1.0f)
dsp_copy_c(ops, dst, src[0], n_samples);

View file

@ -19,7 +19,7 @@ void dsp_mix_gain_sse(struct dsp_ops *ops,
{
if (n_src == 0) {
memset(dst, 0, n_samples * sizeof(float));
} else if (n_src == 1) {
} else if (n_src == 1 && gain[0] == 1.0f) {
if (dst != src[0])
spa_memcpy(dst, src[0], n_samples * sizeof(float));
} else {