bluez5: handle A2DP inverted ClearConfiguration/SetConfiguration order

When in A2DP sink role and remote end switches codec, BlueZ nowadays
appears sometimes emit first SetConfiguration (creating new transport),
and then ClearConfiguration (removing old transport).

Handle this case: emit profiles_changed event always when transports
come/go.

Redefine profiles_changed() to take bitmask of profiles whose connection
status changed, so we don't need to emit two remove+add events.
This commit is contained in:
Pauli Virtanen 2024-12-05 19:58:20 +02:00
parent 5cbf3654c7
commit 2bf48487cb
3 changed files with 37 additions and 32 deletions

View file

@ -468,7 +468,7 @@ struct spa_bt_device_events {
void (*codec_switched) (void *data, int status);
/** Profile configuration changed */
void (*profiles_changed) (void *data, uint32_t prev_profiles, uint32_t prev_connected);
void (*profiles_changed) (void *data, uint32_t connected_change);
/** Device set configuration changed */
void (*device_set_changed) (void *data);