mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
media-session: only deal with state when it changed
Look at the change_mask and only deal with the state when it changed or else we might start the idle timer again when something unrelated changed.
This commit is contained in:
parent
92d5c179d6
commit
1eca773145
1 changed files with 13 additions and 11 deletions
|
|
@ -305,17 +305,19 @@ static void node_event_info(void *object, const struct pw_node_info *info)
|
|||
pw_log_debug(NAME" %p: info for node %d type %d", impl, n->obj.id, n->type);
|
||||
n->info = pw_node_info_update(n->info, info);
|
||||
|
||||
switch (info->state) {
|
||||
case PW_NODE_STATE_IDLE:
|
||||
on_node_idle(impl, n);
|
||||
break;
|
||||
case PW_NODE_STATE_RUNNING:
|
||||
on_node_running(impl, n);
|
||||
break;
|
||||
case PW_NODE_STATE_SUSPENDED:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (info->change_mask & PW_NODE_CHANGE_MASK_STATE) {
|
||||
switch (info->state) {
|
||||
case PW_NODE_STATE_IDLE:
|
||||
on_node_idle(impl, n);
|
||||
break;
|
||||
case PW_NODE_STATE_RUNNING:
|
||||
on_node_running(impl, n);
|
||||
break;
|
||||
case PW_NODE_STATE_SUSPENDED:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue