channelmix: use volume/mute when no channel volumes

When setting a volume without channel volumes, use the volume/mute
instead of doing nothing.
This commit is contained in:
Wim Taymans 2022-09-29 12:35:52 +02:00
parent b7928799e5
commit 25cf4d0a31

View file

@ -540,6 +540,12 @@ static void impl_channelmix_set_volume(struct channelmix *mix, float volume, boo
mix->matrix[i][j] = mix->matrix_orig[i][j] * volumes[i];
}
}
} else {
for (i = 0; i < dst_chan; i++) {
for (j = 0; j < src_chan; j++) {
mix->matrix[i][j] = mix->matrix_orig[i][j] * vol;
}
}
}
SPA_FLAG_SET(mix->flags, CHANNELMIX_FLAG_ZERO);