mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
bluez5: volumes need to be distributed to all channels
Otherwise some channels might become silent. See #741
This commit is contained in:
parent
250a10cd63
commit
8c5ca000ef
1 changed files with 6 additions and 2 deletions
|
|
@ -923,11 +923,15 @@ static int node_set_volume(struct impl *this, struct node *node, float volumes[]
|
||||||
uint8_t buffer[4096];
|
uint8_t buffer[4096];
|
||||||
struct spa_pod_builder b = { 0 };
|
struct spa_pod_builder b = { 0 };
|
||||||
struct spa_pod_frame f[1];
|
struct spa_pod_frame f[1];
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if (n_volumes == 0)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
spa_log_info(this->log, "node %p volume %f", node, volumes[0]);
|
spa_log_info(this->log, "node %p volume %f", node, volumes[0]);
|
||||||
|
|
||||||
node->n_channels = n_volumes;
|
for (i = 0; i < node->n_channels; i++)
|
||||||
memcpy(node->volumes, volumes, sizeof(float) * SPA_AUDIO_MAX_CHANNELS);
|
node->volumes[i] = volumes[i % n_volumes];
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
spa_pod_builder_push_object(&b, &f[0],
|
spa_pod_builder_push_object(&b, &f[0],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue