diff mbox series

[v3,3/3] client/player.c:Adjust the SDU on locations

Message ID 20240108164258.77332-4-silviu.barbulescu@nxp.com
State New
Headers show
Series Add support for multiple BISes | expand

Commit Message

Silviu Florian Barbulescu Jan. 8, 2024, 4:42 p.m. UTC
Adjust the SDU size based on the locations number of
locations for broadcast BISes.

---
 client/player.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/client/player.c b/client/player.c
index fc5ebd602..c892dc6df 100644
--- a/client/player.c
+++ b/client/player.c
@@ -2882,6 +2882,7 @@  static void config_endpoint_channel_location(const char *input, void *user_data)
 	char *endptr = NULL;
 	int value;
 	uint32_t location;
+	uint8_t channels = 1;
 
 	value = strtol(input, &endptr, 0);
 
@@ -2899,6 +2900,13 @@  static void config_endpoint_channel_location(const char *input, void *user_data)
 		iov_append(&cfg->caps, ltv, sizeof(ltv));
 	}
 
+	/* Adjust the SDU size based on the number of
+	 * locations/channels that is being requested.
+	 */
+	channels = __builtin_popcount(location);
+	if (channels > 1)
+		cfg->qos.sdu *= channels;
+
 	/* Add metadata */
 	bt_shell_prompt_input(cfg->ep->path, "Enter Metadata (value/no):",
 			endpoint_set_metadata_cfg, cfg);