@@ -1191,12 +1191,17 @@ static bool parse_base(struct bap_data *bap_data, struct bt_iso_base *base,
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;
}
@@ -6639,29 +6639,22 @@ struct iovec *bt_bap_merge_caps(struct iovec *l2_caps, struct iovec *l3_caps)
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;
}
@@ -255,8 +255,6 @@ struct iovec *bt_bap_merge_caps(struct iovec *l2_caps, struct iovec *l3_caps);
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);
@@ -587,12 +587,13 @@ static void bsnk_pac_added(struct bt_bap_pac *pac, void *user_data)
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);