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

udev: use V4L product ID instead of model ID

Product works for PCI as well, whereas model is only set for USB.
parent 020c20ec
...@@ -225,7 +225,7 @@ static void HandleDevice (services_discovery_t *sd, struct udev_device *dev, ...@@ -225,7 +225,7 @@ static void HandleDevice (services_discovery_t *sd, struct udev_device *dev,
const char *scheme = "v4l2"; /* FIXME: V4L v1 */ const char *scheme = "v4l2"; /* FIXME: V4L v1 */
const char *node = udev_device_get_devnode (dev); const char *node = udev_device_get_devnode (dev);
char *vnd = decode_property (dev, "ID_VENDOR_ENC"); char *vnd = decode_property (dev, "ID_VENDOR_ENC");
char *name = decode_property (dev, "ID_MODEL_ENC"); const char *name = udev_device_get_property_value (dev, "ID_V4L_PRODUCT");
char *mrl; char *mrl;
if (asprintf (&mrl, "%s://%s", scheme, node) == -1) if (asprintf (&mrl, "%s://%s", scheme, node) == -1)
...@@ -238,7 +238,6 @@ static void HandleDevice (services_discovery_t *sd, struct udev_device *dev, ...@@ -238,7 +238,6 @@ static void HandleDevice (services_discovery_t *sd, struct udev_device *dev,
name ? name : "Unnamed", name ? name : "Unnamed",
0, NULL, 0, -1, ITEM_TYPE_CARD); 0, NULL, 0, -1, ITEM_TYPE_CARD);
msg_Dbg (sd, "adding %s", mrl); msg_Dbg (sd, "adding %s", mrl);
free (name);
free (mrl); free (mrl);
if (item != NULL) if (item != NULL)
......
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