mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
media-session: start timeout only when something changed
This commit is contained in:
parent
072d3a191c
commit
fc08c79dad
2 changed files with 8 additions and 6 deletions
|
|
@ -314,9 +314,10 @@ static int handle_profile(struct device *dev)
|
|||
return 0;
|
||||
|
||||
dev->active_profile = pr.index;
|
||||
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);
|
||||
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);
|
||||
add_idle_timeout(impl);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
pw_log_info("device %d: route properties changed %s %s", dev->id, key, val);
|
||||
pw_properties_set(impl->to_restore, key, val);
|
||||
if (pw_properties_set(impl->to_restore, key, val)) {
|
||||
pw_log_info("device %d: route properties changed %s %s", dev->id, key, val);
|
||||
add_idle_timeout(impl);
|
||||
}
|
||||
free(val);
|
||||
add_idle_timeout(impl);
|
||||
i->generation = dev->generation;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue