diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-06-03 17:15:44 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-06-03 17:15:44 +0200 |
commit | 98602f0343c1b0d2962fc318f16a98536ae6d555 (patch) | |
tree | 106db4ff1bf83f39a80a7209839c89e3b3cfbce7 | |
parent | 49ef8f9b5f3444f1d676f8e6d4973a85df2b3db0 (diff) |
alsa-monitor: make valid device path
-rw-r--r-- | spa/plugins/alsa/alsa-monitor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c index 87d9c4b3..e5475e23 100644 --- a/spa/plugins/alsa/alsa-monitor.c +++ b/spa/plugins/alsa/alsa-monitor.c @@ -104,6 +104,7 @@ static int emit_object_info(struct impl *this, uint32_t id, struct udev_device * { struct spa_monitor_object_info info; const char *str, *name; + char path[32]; struct spa_dict_item items[20]; uint32_t n_items = 0; @@ -126,11 +127,12 @@ static int emit_object_info(struct impl *this, uint32_t id, struct udev_device * name = "Unknown"; items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_MONITOR_API, "udev"); - items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_PATH, udev_device_get_devnode(dev)); if ((str = path_get_card_id(udev_device_get_property_value(dev, "DEVPATH"))) == NULL) return 0; + snprintf(path, sizeof(path), "hw:%d", atoi(str)); + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_PATH, path); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_ALSA_CARD, str); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_NAME, name); |