• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Pipewireパッケージ(ちょっと変更)


Commit MetaInfo

Revisión2804a8f1f6af2d28796005fbd2a952e524bb24ab (tree)
Tiempo2023-09-14 00:51:50
AutorPauli Virtanen <pav@iki....>
CommiterP V

Log Message

bluez5: minor BAP broadcast fixups

Don't try to deref NULL if adapter not found. Disable bcast reconnect in
simpler way. Use adapter name as device name. Style fixes.

Cambiar Resumen

Diferencia incremental

--- a/spa/plugins/bluez5/bluez5-dbus.c
+++ b/spa/plugins/bluez5/bluez5-dbus.c
@@ -2382,10 +2382,17 @@ static struct spa_bt_remote_endpoint *remote_endpoint_find(struct spa_bt_monitor
23822382 return NULL;
23832383 }
23842384
2385-static struct spa_bt_device* create_bcast_device(struct spa_bt_monitor *monitor,
2386- const char *object_path)
2385+static struct spa_bt_device *create_bcast_device(struct spa_bt_monitor *monitor, const char *object_path)
23872386 {
23882387 struct spa_bt_device *d;
2388+ struct spa_bt_adapter *adapter;
2389+
2390+ adapter = adapter_find(monitor, object_path);
2391+ if (adapter == NULL) {
2392+ spa_log_warn(monitor->log, "unknown adapter %s", object_path);
2393+ return NULL;
2394+ }
2395+
23892396 d = device_create(monitor, object_path);
23902397 if (d == NULL) {
23912398 spa_log_warn(monitor->log, "can't create Bluetooth device %s: %m",
@@ -2393,22 +2400,12 @@ static struct spa_bt_device* create_bcast_device(struct spa_bt_monitor *monitor,
23932400 return NULL;
23942401 }
23952402
2396- d->adapter = adapter_find(monitor, object_path);
2397- if (d->adapter == NULL) {
2398- spa_log_warn(monitor->log, "unknown adapter %s", d->adapter_path);
2399- }
2400- d->adapter_path = d->adapter->path;
2401- d->alias = strdup("bcast_device");
2402- d->name = strdup("bcast_device");
2403+ d->adapter = adapter;
2404+ d->adapter_path = strdup(adapter->path);
2405+ d->alias = strdup(adapter->alias);
2406+ d->name = strdup(adapter->name);
24032407 d->address = strdup("00:00:00:00:00:00");
2404-
2405- spa_bt_device_check_profiles(d, false);
2406- d->reconnect_state = BT_DEVICE_RECONNECT_INIT;
2407-
2408- if (!device_props_ready(d))
2409- {
2410- return NULL;
2411- }
2408+ d->reconnect_state = BT_DEVICE_RECONNECT_STOP;
24122409
24132410 device_update_hw_volume_profiles(d);
24142411
@@ -2448,6 +2445,7 @@ static int remote_endpoint_update_props(struct spa_bt_remote_endpoint *remote_en
24482445 }
24492446 else if (spa_streq(key, "Device")) {
24502447 struct spa_bt_device *device;
2448+
24512449 device = spa_bt_device_find(monitor, value);
24522450 if (device == NULL) {
24532451 /*
@@ -2456,11 +2454,11 @@ static int remote_endpoint_update_props(struct spa_bt_remote_endpoint *remote_en
24562454 * This is done because BlueZ sets the adapter as the device
24572455 * that is connected to for a broadcast sink endpoint/transport.
24582456 */
2459- if(spa_streq(remote_endpoint->uuid, SPA_BT_UUID_BAP_BROADCAST_SINK)) {
2457+ if (spa_streq(remote_endpoint->uuid, SPA_BT_UUID_BAP_BROADCAST_SINK)) {
24602458 device = create_bcast_device(monitor, value);
2461- if(device == NULL) {
2459+ if (device == NULL)
24622460 goto next;
2463- }
2461+
24642462 remote_endpoint->acceptor = true;
24652463 device_set_connected(device, 1);
24662464 } else {