@@ -4,7 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation. All rights reserved.
- * Copyright 2023 NXP
+ * Copyright 2023-2024 NXP
*
*/
@@ -5114,13 +5114,21 @@ unsigned int bt_bap_stream_metadata(struct bt_bap_stream *stream,
if (!stream)
return 0;
- if (!stream->client) {
- stream_metadata(stream, metadata, NULL);
+ switch (bt_bap_stream_get_type(stream)) {
+ case BT_BAP_STREAM_TYPE_UCAST:
+ if (!stream->client) {
+ stream_metadata(stream, metadata, NULL);
+ return 0;
+ }
+ return bap_stream_metadata(stream, BT_ASCS_METADATA,
+ metadata, func, user_data);
+ case BT_BAP_STREAM_TYPE_BCAST:
+ util_iov_free(stream->meta, 1);
+ stream->meta = util_iov_dup(metadata, 1);
+ return 1;
+ default:
return 0;
}
-
- return bap_stream_metadata(stream, BT_ASCS_METADATA, metadata, func,
- user_data);
}
unsigned int bt_bap_stream_release(struct bt_bap_stream *stream,