From 713655c10fe268a548ec0186f0c5d84cd59beeb9 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 7 Apr 2025 15:41:46 -0400 Subject: [PATCH] shared/bap: Fix notifying with the wrong state stream_notify_metadata is reused by a couple of states so it needs to pass on the actual state to be notified rather than using ep->state which may have been transitioned already. --- src/shared/bap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 76f221102..be35c2e60 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1088,7 +1088,7 @@ static void stream_notify_qos(struct bt_bap_stream *stream) free(status); } -static void stream_notify_metadata(struct bt_bap_stream *stream) +static void stream_notify_metadata(struct bt_bap_stream *stream, uint8_t state) { struct bt_bap_endpoint *ep = stream->ep; struct bt_ascs_ase_status *status; @@ -1106,7 +1106,7 @@ static void stream_notify_metadata(struct bt_bap_stream *stream) memset(status, 0, len); status->id = ep->id; - status->state = ep->state; + status->state = state; meta = (void *)status->params; meta->cis_id = stream->qos.ucast.cis_id; @@ -1738,7 +1738,7 @@ static void stream_notify(struct bt_bap_stream *stream, uint8_t state) case BT_ASCS_ASE_STATE_ENABLING: case BT_ASCS_ASE_STATE_STREAMING: case BT_ASCS_ASE_STATE_DISABLING: - stream_notify_metadata(stream); + stream_notify_metadata(stream, state); break; case BT_ASCS_ASE_STATE_RELEASING: stream_notify_release(stream); -- 2.47.3