Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using USB devices with the same name. #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions spa/plugins/alsa/acp/acp.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,14 @@ static void init_device(pa_card *impl, pa_alsa_device *dev, pa_alsa_direction_t
pa_alsa_mapping *m, uint32_t index)
{
char **d;
char description_rename[strlen(m->description)+14];
sprintf(description_rename, "%s%i", m->description, impl->card.index);

dev->card = impl;
dev->mapping = m;
dev->device.index = index;
dev->device.name = m->name;
dev->device.description = m->description;
dev->device.description = description_rename;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description is on the stack and can't be added to this structure.

dev->device.priority = m->priority;
dev->device.device_strings = (const char **)m->device_strings;
dev->device.format.format_mask = m->sample_spec.format;
Expand All @@ -229,7 +231,7 @@ static void init_device(pa_card *impl, pa_alsa_device *dev, pa_alsa_direction_t
pa_proplist_update(dev->proplist, PA_UPDATE_REPLACE, m->input_proplist);
}
pa_proplist_sets(dev->proplist, PA_PROP_DEVICE_PROFILE_NAME, m->name);
pa_proplist_sets(dev->proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, m->description);
pa_proplist_sets(dev->proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, description_rename);
pa_proplist_setf(dev->proplist, "card.profile.device", "%u", index);
pa_proplist_as_dict(dev->proplist, &dev->device.props);

Expand Down