bluez5: fix volume ids

Node ids don't map directly to volume ids. Fix the indexing.
This commit is contained in:
Pauli Virtanen 2025-04-08 01:04:42 +03:00 committed by Wim Taymans
parent b15ec9bec9
commit bbe1587f71
2 changed files with 19 additions and 7 deletions

View file

@ -3608,9 +3608,13 @@ fail:
static int transport_set_volume(void *data, int id, float volume)
{
struct spa_bt_transport *transport = data;
struct spa_bt_transport_volume *t_volume = &transport->volumes[id];
struct spa_bt_transport_volume *t_volume;
uint16_t value;
spa_assert(id >= 0 && id < (int)SPA_N_ELEMENTS(transport->volumes));
t_volume = &transport->volumes[id];
if (!t_volume->active || !spa_bt_transport_volume_enabled(transport))
return -ENOTSUP;