media-session: start timeout only when something changed

This commit is contained in:
Wim Taymans 2021-01-28 14:36:29 +01:00
parent 072d3a191c
commit fc08c79dad
2 changed files with 8 additions and 6 deletions

View file

@ -314,10 +314,11 @@ static int handle_profile(struct device *dev)
return 0;
dev->active_profile = pr.index;
if (pw_properties_setf(impl->properties, dev->key, "{ \"name\": \"%s\" }", pr.name)) {
pw_log_info("device '%s': active profile changed to '%s'", dev->name, pr.name);
pw_properties_setf(impl->properties, dev->key, "{ \"name\": \"%s\" }", pr.name);
add_idle_timeout(impl);
}
}
return 0;
}

View file

@ -412,10 +412,11 @@ static int handle_route(struct device *dev, struct route *r)
restore_route(dev, val, r->index, r->device_id);
} else if (r->props) {
char *val = serialize_props(dev, r->props);
if (pw_properties_set(impl->to_restore, key, val)) {
pw_log_info("device %d: route properties changed %s %s", dev->id, key, val);
pw_properties_set(impl->to_restore, key, val);
free(val);
add_idle_timeout(impl);
}
free(val);
i->generation = dev->generation;
}
return 0;