mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: leave vendor.id and product.id in hex
There is no reason to store this as anything other than the original hex string. Especially for compatibility with pulseaudio. See !1298
This commit is contained in:
		
							parent
							
								
									a44c600ade
								
							
						
					
					
						commit
						0d33760b71
					
				
					 2 changed files with 8 additions and 33 deletions
				
			
		| 
						 | 
					@ -477,15 +477,9 @@ static int emit_object_info(struct impl *this, struct device *device)
 | 
				
			||||||
	if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) {
 | 
						if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) {
 | 
				
			||||||
		items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str);
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) {
 | 
						if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str)
 | 
				
			||||||
		char *dec = alloca(6); /* 65535 is max */
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, str);
 | 
				
			||||||
		int32_t val;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (spa_atoi32(str, &val, 16)) {
 | 
					 | 
				
			||||||
			snprintf(dec, 6, "%d", val);
 | 
					 | 
				
			||||||
			items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, dec);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE");
 | 
						str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE");
 | 
				
			||||||
	if (!(str && *str)) {
 | 
						if (!(str && *str)) {
 | 
				
			||||||
		str = udev_device_get_property_value(dev, "ID_VENDOR_ENC");
 | 
							str = udev_device_get_property_value(dev, "ID_VENDOR_ENC");
 | 
				
			||||||
| 
						 | 
					@ -500,15 +494,9 @@ static int emit_object_info(struct impl *this, struct device *device)
 | 
				
			||||||
	if (str && *str) {
 | 
						if (str && *str) {
 | 
				
			||||||
		items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str);
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) {
 | 
						if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str)
 | 
				
			||||||
		char *dec = alloca(6); /* 65535 is max */
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, str);
 | 
				
			||||||
		int32_t val;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (spa_atoi32(str, &val, 16)) {
 | 
					 | 
				
			||||||
			snprintf(dec, 6, "%d", val);
 | 
					 | 
				
			||||||
			items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, dec);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
 | 
						str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
 | 
				
			||||||
	if (!(str && *str)) {
 | 
						if (!(str && *str)) {
 | 
				
			||||||
		str = udev_device_get_property_value(dev, "ID_MODEL_ENC");
 | 
							str = udev_device_get_property_value(dev, "ID_MODEL_ENC");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -278,15 +278,9 @@ static int emit_object_info(struct impl *this, struct device *device)
 | 
				
			||||||
	if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) {
 | 
						if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) {
 | 
				
			||||||
		items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str);
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) {
 | 
						if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str)
 | 
				
			||||||
		char *dec = alloca(6); /* 65535 is max */
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, str);
 | 
				
			||||||
		int32_t val;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (spa_atoi32(str, &val, 16)) {
 | 
					 | 
				
			||||||
			snprintf(dec, 6, "%d", val);
 | 
					 | 
				
			||||||
			items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, dec);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE");
 | 
						str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE");
 | 
				
			||||||
	if (!(str && *str)) {
 | 
						if (!(str && *str)) {
 | 
				
			||||||
		str = udev_device_get_property_value(dev, "ID_VENDOR_ENC");
 | 
							str = udev_device_get_property_value(dev, "ID_VENDOR_ENC");
 | 
				
			||||||
| 
						 | 
					@ -301,15 +295,8 @@ static int emit_object_info(struct impl *this, struct device *device)
 | 
				
			||||||
	if (str && *str) {
 | 
						if (str && *str) {
 | 
				
			||||||
		items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str);
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) {
 | 
						if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str)
 | 
				
			||||||
		char *dec = alloca(6); /* 65535 is max */
 | 
							items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, str);
 | 
				
			||||||
		int32_t val;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (spa_atoi32(str, &val, 16)) {
 | 
					 | 
				
			||||||
			snprintf(dec, 6, "%d", val);
 | 
					 | 
				
			||||||
			items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, dec);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
 | 
						str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
 | 
				
			||||||
	if (!(str && *str)) {
 | 
						if (!(str && *str)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue