[PATCH BlueZ 9/9] transport: Trigger transport reacquire for multiple BISes sync

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

 



Once the transport is release, bap_stop_complete is called. If the
transport is part of a sync with multiple BISes, it needs to be
reacquired. Such a transport will have it's stream in the
BT_BAP_STREAM_STATE_PENDING state. Thus, transport_update_playing
with playing set to TRUE must be called. This will set the transport
state to BROADCASTING, so that the audio server will automatically
acquire it.
---
 profiles/audio/transport.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index e68695c39..4ea793a27 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -705,13 +705,16 @@ static DBusMessage *try_acquire(DBusConnection *conn, DBusMessage *msg,
 	return NULL;
 }
 
+static void transport_update_playing(struct media_transport *transport,
+							gboolean playing);
+
 static void bap_stop_complete(struct bt_bap_stream *stream,
 					uint8_t code, uint8_t reason,
 					void *user_data)
 {
-	struct media_owner *owner = user_data;
 	struct media_request *req;
-	struct media_transport *transport;
+	struct media_transport *transport = user_data;
+	struct media_owner *owner = transport->owner;
 
 	if (!owner)
 		return;
@@ -731,6 +734,11 @@ static void bap_stop_complete(struct bt_bap_stream *stream,
 		transport_set_state(transport, TRANSPORT_STATE_IDLE);
 		media_transport_remove_owner(transport);
 	}
+	if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_PENDING)
+		/* Transports with streams in this state should be reaquired as
+		 * part of a multiple BIS sync.
+		 */
+		transport_update_playing(transport, TRUE);
 }
 
 static void bap_disable_complete(struct bt_bap_stream *stream,
@@ -1707,7 +1715,8 @@ static guint transport_bap_suspend(struct media_transport *transport,
 
 	if (bt_bap_stream_get_type(bap->stream) == BT_BAP_STREAM_TYPE_BCAST) {
 		if (transport->owner == owner)
-			bap_disable_complete(bap->stream, 0x00, 0x00, owner);
+			bap_disable_complete(bap->stream, 0x00, 0x00,
+				transport);
 		return 0;
 	}
 
-- 
2.40.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