Diff between 07d427227a1ba2f062cb108b79c868b938528eb6 and 0ff7392af164e5c5453722bd4adb780190db33ea

Changed Files

File Additions Deletions Status
profiles/audio/bap.c +7 -1 modified

Full Patch

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 23cadde..52a9f5e 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -277,7 +277,13 @@ static gboolean get_codec(const GDBusPropertyTable *property,
 	struct bap_ep *ep = data;
 	uint8_t codec;
 
-	bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL);
+	/* For broadcast source, rpac is null so the codec
+	 * is retrieved from the lpac
+	 */
+	if (ep->rpac == NULL)
+		bt_bap_pac_get_codec(ep->lpac, &codec, NULL, NULL);
+	else
+		bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL);
 
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &codec);