This means that the path names will always correspond to the
path configuration file names, so they will automatically be
unique (in the scope of one card).
{ "priority", pa_config_parse_unsigned, NULL, "General" },
{ "description-key", pa_config_parse_string, NULL, "General" },
{ "description", pa_config_parse_string, NULL, "General" },
{ "priority", pa_config_parse_unsigned, NULL, "General" },
{ "description-key", pa_config_parse_string, NULL, "General" },
{ "description", pa_config_parse_string, NULL, "General" },
- { "name", pa_config_parse_string, NULL, "General" },
{ "mute-during-activation", pa_config_parse_bool, NULL, "General" },
{ "eld-device", pa_config_parse_int, NULL, "General" },
{ "mute-during-activation", pa_config_parse_bool, NULL, "General" },
{ "eld-device", pa_config_parse_int, NULL, "General" },
items[0].data = &p->priority;
items[1].data = &p->description_key;
items[2].data = &p->description;
items[0].data = &p->priority;
items[1].data = &p->description_key;
items[2].data = &p->description;
- items[3].data = &p->name;
- items[4].data = &mute_during_activation;
- items[5].data = &p->eld_device;
+ items[3].data = &mute_during_activation;
+ items[4].data = &p->eld_device;
if (!paths_dir)
paths_dir = get_default_paths_dir();
if (!paths_dir)
paths_dir = get_default_paths_dir();
-static pa_alsa_path* path_set_find_path_by_name(pa_alsa_path_set *ps, const char* name, pa_alsa_path *ignore)
-{
+static pa_alsa_path* path_set_find_path_by_description(pa_alsa_path_set *ps, const char* description, pa_alsa_path *ignore) {
pa_alsa_path* p;
void *state;
PA_HASHMAP_FOREACH(p, ps->paths, state)
pa_alsa_path* p;
void *state;
PA_HASHMAP_FOREACH(p, ps->paths, state)
- if (p != ignore && pa_streq(p->name, name))
+ if (p != ignore && pa_streq(p->description, description))
-static void path_set_make_paths_unique(pa_alsa_path_set *ps) {
+static void path_set_make_path_descriptions_unique(pa_alsa_path_set *ps) {
pa_alsa_path *p, *q;
void *state, *state2;
PA_HASHMAP_FOREACH(p, ps->paths, state) {
unsigned i;
pa_alsa_path *p, *q;
void *state, *state2;
PA_HASHMAP_FOREACH(p, ps->paths, state) {
unsigned i;
- q = path_set_find_path_by_name(ps, p->name, p);
+ q = path_set_find_path_by_description(ps, p->description, p);
- m = pa_xstrdup(p->name);
+ old_description = pa_xstrdup(p->description);
- /* OK, this name is not unique, hence let's rename */
+ /* OK, this description is not unique, hence let's rename */
i = 1;
PA_HASHMAP_FOREACH(q, ps->paths, state2) {
i = 1;
PA_HASHMAP_FOREACH(q, ps->paths, state2) {
- if (!pa_streq(q->name, m))
+ if (!pa_streq(q->description, old_description))
- nn = pa_sprintf_malloc("%s-%u", m, i);
- pa_xfree(q->name);
- q->name = nn;
-
- nd = pa_sprintf_malloc("%s %u", q->description, i);
+ new_description = pa_sprintf_malloc("%s %u", q->description, i);
pa_xfree(q->description);
pa_xfree(q->description);
+ q->description = new_description;
+ pa_xfree(old_description);
}
path_set_condense(ps, mixer_handle);
}
path_set_condense(ps, mixer_handle);
- path_set_make_paths_unique(ps);
+ path_set_make_path_descriptions_unique(ps);
if (mixer_handle)
snd_mixer_close(mixer_handle);
if (mixer_handle)
snd_mixer_close(mixer_handle);