Skip to content

Commit

Permalink
player: Adjust SDU size based on the number of locations
Browse files Browse the repository at this point in the history
Adjust the SDU size based on the number of locations/channels
that is being requested.
  • Loading branch information
silviubarbulescu authored and Vudentz committed Mar 22, 2024
1 parent bbf1982 commit a2b2d2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/player.c
Expand Up @@ -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;
Expand All @@ -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):",
Expand Down

0 comments on commit a2b2d2e

Please sign in to comment.