From a2b2d2e4ab0ee375b24007e23f19e3122fa33764 Mon Sep 17 00:00:00 2001 From: Silviu Florian Barbulescu Date: Thu, 21 Mar 2024 18:12:55 +0200 Subject: [PATCH] player: Adjust SDU size based on the number of locations Adjust the SDU size based on the number of locations/channels that is being requested. --- client/player.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/player.c b/client/player.c index d3ff15adb..1f56bfd27 100644 --- a/client/player.c +++ b/client/player.c @@ -3558,6 +3558,7 @@ static void config_endpoint_channel_location(const char *input, void *user_data) struct endpoint_config *cfg = user_data; char *endptr = NULL; uint32_t location; + uint8_t channels = 1; if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) goto add_meta; @@ -3574,6 +3575,13 @@ static void config_endpoint_channel_location(const char *input, void *user_data) util_ltv_push(cfg->caps, LC3_CONFIG_CHAN_ALLOC_LEN - 1, LC3_CONFIG_CHAN_ALLOC, &location); + /* Adjust the SDU size based on the number of + * locations/channels that is being requested. + */ + channels = __builtin_popcount(location); + if (channels > 1) + cfg->qos.bcast.io_qos.sdu *= channels; + add_meta: /* Add metadata */ bt_shell_prompt_input(cfg->ep->path, "Enter Metadata (value/no):", -- 2.47.3