From 32084ff3c66d4bdf6e4d308a4aa7fff0d2b8af6a Mon Sep 17 00:00:00 2001 From: Silviu Florian Barbulescu Date: Tue, 22 Aug 2023 14:53:51 +0300 Subject: [PATCH] Fix problems found in the review of the broadcast sink support. --- spa/plugins/bluez5/bluez5-dbus.c | 13 +++++-------- spa/plugins/bluez5/bluez5-device.c | 3 --- spa/plugins/bluez5/iso-io.c | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index edc1ac617..f36c44e28 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -2273,7 +2273,7 @@ bool spa_bt_device_supports_media_codec(struct spa_bt_device *device, const stru spa_list_for_each(ep, &device->remote_endpoint_list, device_link) { enum spa_bt_profile profile = spa_bt_profile_from_uuid(ep->uuid); if (codec->bap) { - if((profile == SPA_BT_PROFILE_BAP_BROADCAST_SINK) || (profile == SPA_BT_PROFILE_BAP_BROADCAST_SOURCE)) + if ((profile == SPA_BT_PROFILE_BAP_BROADCAST_SINK) || (profile == SPA_BT_PROFILE_BAP_BROADCAST_SOURCE)) codec_profile = sink ? SPA_BT_PROFILE_BAP_BROADCAST_SINK : SPA_BT_PROFILE_BAP_BROADCAST_SOURCE; else codec_profile = sink ? SPA_BT_PROFILE_BAP_SINK : SPA_BT_PROFILE_BAP_SOURCE; @@ -3389,7 +3389,7 @@ static int transport_create_iso_io(struct spa_bt_transport *transport) struct spa_bt_transport *t; if (!(transport->profile & (SPA_BT_PROFILE_BAP_SINK | SPA_BT_PROFILE_BAP_SOURCE | - SPA_BT_PROFILE_BAP_BROADCAST_SINK || SPA_BT_PROFILE_BAP_BROADCAST_SOURCE))) + SPA_BT_PROFILE_BAP_BROADCAST_SINK | SPA_BT_PROFILE_BAP_BROADCAST_SOURCE))) return 0; if ((transport->profile == SPA_BT_PROFILE_BAP_BROADCAST_SINK) || @@ -4741,8 +4741,7 @@ static DBusHandlerResult object_manager_handler(DBusConnection *c, DBusMessage * } } - if(codec->bap && register_bcast) - { + if (codec->bap && register_bcast) { if (endpoint_should_be_registered(monitor, codec, SPA_BT_MEDIA_SOURCE_BROADCAST)) { caps_size = codec->fill_caps(codec, 0, caps); if (caps_size < 0) @@ -4900,8 +4899,7 @@ static int register_media_application(struct spa_bt_monitor * monitor) register_media_endpoint(monitor, codec, SPA_BT_MEDIA_SOURCE); register_media_endpoint(monitor, codec, SPA_BT_MEDIA_SINK); - if(codec->bap) - { + if (codec->bap) { register_media_endpoint(monitor, codec, SPA_BT_MEDIA_SOURCE_BROADCAST); register_media_endpoint(monitor, codec, SPA_BT_MEDIA_SINK_BROADCAST); } @@ -4937,8 +4935,7 @@ static void unregister_media_application(struct spa_bt_monitor * monitor) unregister_media_endpoint(monitor, codec, SPA_BT_MEDIA_SOURCE); unregister_media_endpoint(monitor, codec, SPA_BT_MEDIA_SINK); - if(codec->bap) - { + if (codec->bap) { unregister_media_endpoint(monitor, codec, SPA_BT_MEDIA_SOURCE_BROADCAST); unregister_media_endpoint(monitor, codec, SPA_BT_MEDIA_SINK_BROADCAST); } diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c index 23918b054..02a3226b5 100644 --- a/spa/plugins/bluez5/bluez5-device.c +++ b/spa/plugins/bluez5/bluez5-device.c @@ -1069,9 +1069,6 @@ static int emit_nodes(struct impl *this) emit_dynamic_node(&this->dyn_media_source, this, t, DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_MEDIA_SOURCE, false); } - - if (this->device_set.leader && this->device_set.sources > 0) - emit_device_set_node(this, DEVICE_ID_SOURCE_SET); } if (get_supported_media_codec(this, this->props.codec, NULL) == NULL) diff --git a/spa/plugins/bluez5/iso-io.c b/spa/plugins/bluez5/iso-io.c index e8aeca7d0..68ceb6b69 100644 --- a/spa/plugins/bluez5/iso-io.c +++ b/spa/plugins/bluez5/iso-io.c @@ -319,7 +319,7 @@ static struct stream *stream_create(struct spa_bt_transport *t, struct group *gr if((t->profile == SPA_BT_PROFILE_BAP_SINK) || (t->profile == SPA_BT_PROFILE_BAP_BROADCAST_SINK)) { sink = true; - } else{ + } else { sink = false; }