Commit d54c2b59 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

udev ALSA: use model name if available

parent 26b5b697
...@@ -469,13 +469,21 @@ static char *alsa_get_mrl (struct udev_device *dev) ...@@ -469,13 +469,21 @@ static char *alsa_get_mrl (struct udev_device *dev)
static char *alsa_get_name (struct udev_device *dev) static char *alsa_get_name (struct udev_device *dev)
{ {
const char *model = NULL;
char *name; char *name;
unsigned card, device; unsigned card, device;
if (alsa_get_device (dev, &card, &device)) if (alsa_get_device (dev, &card, &device))
return NULL; return NULL;
if (asprintf (&name, _("Device %u"), device) == -1) dev = udev_device_get_parent (dev);
if (dev != NULL)
model = udev_device_get_property_value (dev,
"ID_MODEL_FROM_DATABASE");
if (model == NULL)
model = _("Device");
if (asprintf (&name, "%s (%u)", model, device) == -1)
name = NULL; name = NULL;
return name; return name;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment