suspend-node: only suspend devices

This commit is contained in:
Wim Taymans 2020-01-08 15:16:17 +01:00
parent a3ddc6b744
commit 92c26fa124

View file

@ -158,6 +158,15 @@ static int
handle_node(struct impl *impl, struct sm_object *object)
{
struct node *node;
const char *media_class;
media_class = object->props ? pw_properties_get(object->props, PW_KEY_MEDIA_CLASS) : NULL;
if (media_class == NULL)
return 0;
if (strstr(media_class, "Audio/") != media_class &&
(strstr(media_class, "Video/") != media_class))
return 0;
node = sm_object_add_data(object, SESSION_KEY, sizeof(struct node));
node->obj = (struct sm_node*)object;