diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 16c0252..81b5051 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
l3_caps->iov_len, NULL, print_ltv,
func);
+ merged_caps = bt_bap_merge_caps(l2_caps, l3_caps);
+ if (!merged_caps) {
+ free(path);
+ continue;
+ }
+
/* Check if this BIS matches any local PAC */
bt_bap_verify_bis(bap_data->bap, bis_index, &codec,
- l2_caps, l3_caps, &matched_lpac,
- &merged_caps);
+ merged_caps, &matched_lpac);
- if (matched_lpac == NULL || merged_caps == NULL) {
+ if (matched_lpac == NULL) {
free(path);
continue;
}
diff --git a/src/shared/bap.c b/src/shared/bap.c
index 1259ee3..3381ffd 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index,
struct bt_bap_codec *codec,
- struct iovec *l2_caps,
- struct iovec *l3_caps,
- struct bt_bap_pac **lpac,
- struct iovec **caps)
+ struct iovec *caps,
+ struct bt_bap_pac **lpac)
{
- struct iovec *merged_caps;
struct bt_ltv_match match_data;
- merged_caps = bt_bap_merge_caps(l2_caps, l3_caps);
- if (!merged_caps)
+ if (!caps)
return;
/* Check each BIS Codec Specific Configuration LTVs against our Codec
* Specific Capabilities and if the BIS matches create a PAC with it
*/
- match_data = bap_check_bis(bap->ldb, merged_caps);
+ match_data = bap_check_bis(bap->ldb, caps);
if (match_data.found == true) {
- *caps = merged_caps;
*lpac = match_data.data;
DBG(bap, "Matching BIS %i", bis_index);
} else {
- util_iov_free(merged_caps, 1);
- *caps = NULL;
*lpac = NULL;
}
diff --git a/src/shared/bap.h b/src/shared/bap.h
index e63161d..3e68f00 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index,
struct bt_bap_codec *codec,
- struct iovec *l2_caps,
- struct iovec *l3_caps,
- struct bt_bap_pac **lpac,
- struct iovec **caps);
+ struct iovec *caps,
+ struct bt_bap_pac **lpac);
diff --git a/unit/test-bap.c b/unit/test-bap.c
index 9dd7a45..4b47d63 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
codec.id = LC3_ID;
for (uint8_t i = 0; i < data->cfg->streams; i++) {
- bt_bap_verify_bis(data->bap, bis_idx++, &codec,
- &data->cfg->cc, NULL, &lpac, &cc);
+ cc = bt_bap_merge_caps(&data->cfg->cc, NULL);
+ g_assert(cc);
+
+ bt_bap_verify_bis(data->bap, bis_idx++, &codec, cc, &lpac);
g_assert(lpac);
g_assert(pac == lpac);
- g_assert(cc);
stream = bt_bap_stream_new(data->bap,
pac, NULL, &data->cfg->qos, cc);