[PATCH BlueZ] transport: fix A2DP Delay values missing from DBus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With headsets, a2dp_transport::session == NULL usually until stream
resumes. During this time, delay_reporting_exists() incorrectly returns
FALSE, because streams corresponding to NULL session cannot be found.
As no further "Delay" property updates will usually arrive, the property
remains missing even though delay reports have been received.

Fix by setting a2dp->session when processing a delay report, if missing.

Log (bluetoothctl):
[NEW] Transport /org/bluez/hci1/dev_XX_XX_XX_XX_XX_XX/sep2/fd1
[CHG] Transport /org/bluez/hci1/dev_XX_XX_XX_XX_XX_XX/sep2/fd1 Delay is nil
---
 profiles/audio/transport.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 2b9832a76..ab149bcd7 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -2649,6 +2649,9 @@ void media_transport_update_delay(struct media_transport *transport,
 	if (a2dp->delay == delay)
 		return;
 
+	if (a2dp->session == NULL)
+		a2dp->session = a2dp_avdtp_get(transport->device);
+
 	a2dp->delay = delay;
 
 	g_dbus_emit_property_changed(btd_get_dbus_connection(),
-- 
2.50.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux