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

udev ALSA: don't be reliant on device node path, use kernel path

parent 9744c601
......@@ -439,12 +439,13 @@ int OpenV4L (vlc_object_t *obj)
static int alsa_get_device (struct udev_device *dev, unsigned *restrict pcard,
unsigned *restrict pdevice)
{
const char *node = udev_device_get_devnode (dev);
const char *node = udev_device_get_devpath (dev);
char type;
node = strrchr (node, '/');
if (node == NULL)
return -1;
if (sscanf (node, "/dev/snd/pcmC%uD%u%c", pcard, pdevice, &type) < 3)
if (sscanf (node, "/pcmC%uD%u%c", pcard, pdevice, &type) < 3)
return -1;
if (type != 'c')
return -1;
......
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