pulse-server: increase channel name length

, and AUX11 and the \0 need at least 8 chars, 6 chars will truncate
after AUX1 and leave an invalid channel map.
This commit is contained in:
Wim Taymans 2021-12-22 21:15:46 +01:00
parent c1a0a602a5
commit 2905635de3
7 changed files with 14 additions and 14 deletions

View file

@ -160,9 +160,9 @@ static void position_to_props(struct spa_audio_info_raw *info, struct pw_propert
uint32_t i; uint32_t i;
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels);
p = s = alloca(info->channels * 6); p = s = alloca(info->channels * 8);
for (i = 0; i < info->channels; i++) for (i = 0; i < info->channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info->position[i])); channel_id2name(info->position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }

View file

@ -160,9 +160,9 @@ static void position_to_props(struct spa_audio_info_raw *info, struct pw_propert
uint32_t i; uint32_t i;
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels);
p = s = alloca(info->channels * 6); p = s = alloca(info->channels * 8);
for (i = 0; i < info->channels; i++) for (i = 0; i < info->channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info->position[i])); channel_id2name(info->position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }

View file

@ -177,9 +177,9 @@ struct module *create_module_null_sink(struct impl *impl, const char *argument)
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info.channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info.channels);
p = s = alloca(info.channels * 6); p = s = alloca(info.channels * 8);
for (i = 0; i < info.channels; i++) for (i = 0; i < info.channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info.position[i])); channel_id2name(info.position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }

View file

@ -139,9 +139,9 @@ static void position_to_props(struct spa_audio_info_raw *info, struct pw_propert
uint32_t i; uint32_t i;
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels);
p = s = alloca(info->channels * 6); p = s = alloca(info->channels * 8);
for (i = 0; i < info->channels; i++) for (i = 0; i < info->channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info->position[i])); channel_id2name(info->position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }

View file

@ -139,9 +139,9 @@ static void position_to_props(struct spa_audio_info_raw *info, struct pw_propert
uint32_t i; uint32_t i;
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels);
p = s = alloca(info->channels * 6); p = s = alloca(info->channels * 8);
for (i = 0; i < info->channels; i++) for (i = 0; i < info->channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info->position[i])); channel_id2name(info->position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }

View file

@ -144,9 +144,9 @@ static void audio_info_to_props(struct spa_audio_info_raw *info, struct pw_prope
uint32_t i; uint32_t i;
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels);
p = s = alloca(info->channels * 6); p = s = alloca(info->channels * 8);
for (i = 0; i < info->channels; i++) for (i = 0; i < info->channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info->position[i])); channel_id2name(info->position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }

View file

@ -144,9 +144,9 @@ static void audio_info_to_props(struct spa_audio_info_raw *info, struct pw_prope
uint32_t i; uint32_t i;
pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels); pw_properties_setf(props, SPA_KEY_AUDIO_CHANNELS, "%u", info->channels);
p = s = alloca(info->channels * 6); p = s = alloca(info->channels * 8);
for (i = 0; i < info->channels; i++) for (i = 0; i < info->channels; i++)
p += snprintf(p, 6, "%s%s", i == 0 ? "" : ",", p += snprintf(p, 8, "%s%s", i == 0 ? "" : ",",
channel_id2name(info->position[i])); channel_id2name(info->position[i]));
pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s); pw_properties_set(props, SPA_KEY_AUDIO_POSITION, s);
} }