impl-node: improve reason string in recalc_graph

Don't just report "quantum changed" as the reason for recalculating
the graph but make it depend on what actually happened.
This commit is contained in:
Wim Taymans 2021-03-31 13:28:33 +02:00
parent b9d1b818d5
commit 427e8abf0c

View file

@ -815,8 +815,8 @@ static void check_properties(struct pw_impl_node *node)
{
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
struct pw_context *context = node->context;
const char *str;
bool driver, do_recalc = false;
const char *str, *recalc_reason = NULL;
bool driver;
uint32_t group_id;
if ((str = pw_properties_get(node->properties, PW_KEY_PRIORITY_DRIVER))) {
@ -833,7 +833,7 @@ static void check_properties(struct pw_impl_node *node)
if (group_id != node->group_id) {
pw_log_debug(NAME" %p: group %u->%u", node, node->group_id, group_id);
node->group_id = group_id;
do_recalc = true;
recalc_reason = "group changed";
}
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_NAME)) &&
@ -867,7 +867,7 @@ static void check_properties(struct pw_impl_node *node)
else
spa_list_remove(&node->driver_link);
}
do_recalc = true;
recalc_reason = "driver changed";
}
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_ALWAYS_PROCESS)))
@ -892,7 +892,7 @@ static void check_properties(struct pw_impl_node *node)
node->info.id, str, quantum_size,
context->defaults.clock_rate);
node->quantum_size = quantum_size;
do_recalc = true;
recalc_reason = "quantum changed";
}
}
}
@ -913,16 +913,17 @@ static void check_properties(struct pw_impl_node *node)
node->info.id, str, max_quantum_size,
context->defaults.clock_rate);
node->max_quantum_size = max_quantum_size;
do_recalc = true;
recalc_reason = "max quantum changed";
}
}
}
pw_log_debug(NAME" %p: driver:%d recalc:%d active:%d", node, node->driver,
do_recalc, node->active);
pw_log_debug(NAME" %p: driver:%d recalc:%s active:%d", node, node->driver,
recalc_reason, node->active);
if (do_recalc && node->active)
pw_context_recalc_graph(context, "quantum change");
if (recalc_reason && node->active)
pw_context_recalc_graph(context, recalc_reason);
}
static const char *str_status(uint32_t status)