mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
spa/v4l2: better device product names on current kernels
udev/kernel sometimes give "Video Capture N" as ID_V4L_PRODUCT, which is bogus as a device product name. The ID_MODEL* field seem to always have a sensible product name. Get device.product.name always from ID_MODEL*, and use ID_V4L_PRODUCT only as the last fallback.
This commit is contained in:
parent
e1bc1c4569
commit
a67f38f790
1 changed files with 9 additions and 10 deletions
|
|
@ -311,18 +311,17 @@ static int emit_object_info(struct impl *this, struct device *device)
|
|||
}
|
||||
}
|
||||
|
||||
str = udev_device_get_property_value(dev, "ID_V4L_PRODUCT");
|
||||
str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
|
||||
if (!(str && *str)) {
|
||||
str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
|
||||
str = udev_device_get_property_value(dev, "ID_MODEL_ENC");
|
||||
if (!(str && *str)) {
|
||||
str = udev_device_get_property_value(dev, "ID_MODEL_ENC");
|
||||
if (!(str && *str)) {
|
||||
str = udev_device_get_property_value(dev, "ID_MODEL");
|
||||
} else {
|
||||
char *t = alloca(strlen(str) + 1);
|
||||
unescape(str, t);
|
||||
str = t;
|
||||
}
|
||||
str = udev_device_get_property_value(dev, "ID_MODEL");
|
||||
if (!(str && *str))
|
||||
str = udev_device_get_property_value(dev, "ID_V4L_PRODUCT");
|
||||
} else {
|
||||
char *t = alloca(strlen(str) + 1);
|
||||
unescape(str, t);
|
||||
str = t;
|
||||
}
|
||||
}
|
||||
if (str && *str)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue