mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
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:
parent
b9d1b818d5
commit
427e8abf0c
1 changed files with 11 additions and 10 deletions
|
|
@ -815,8 +815,8 @@ static void check_properties(struct pw_impl_node *node)
|
||||||
{
|
{
|
||||||
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
|
struct impl *impl = SPA_CONTAINER_OF(node, struct impl, this);
|
||||||
struct pw_context *context = node->context;
|
struct pw_context *context = node->context;
|
||||||
const char *str;
|
const char *str, *recalc_reason = NULL;
|
||||||
bool driver, do_recalc = false;
|
bool driver;
|
||||||
uint32_t group_id;
|
uint32_t group_id;
|
||||||
|
|
||||||
if ((str = pw_properties_get(node->properties, PW_KEY_PRIORITY_DRIVER))) {
|
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) {
|
if (group_id != node->group_id) {
|
||||||
pw_log_debug(NAME" %p: group %u->%u", node, node->group_id, group_id);
|
pw_log_debug(NAME" %p: group %u->%u", node, node->group_id, group_id);
|
||||||
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)) &&
|
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
|
else
|
||||||
spa_list_remove(&node->driver_link);
|
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)))
|
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,
|
node->info.id, str, quantum_size,
|
||||||
context->defaults.clock_rate);
|
context->defaults.clock_rate);
|
||||||
node->quantum_size = quantum_size;
|
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,
|
node->info.id, str, max_quantum_size,
|
||||||
context->defaults.clock_rate);
|
context->defaults.clock_rate);
|
||||||
node->max_quantum_size = max_quantum_size;
|
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,
|
pw_log_debug(NAME" %p: driver:%d recalc:%s active:%d", node, node->driver,
|
||||||
do_recalc, node->active);
|
recalc_reason, node->active);
|
||||||
|
|
||||||
if (do_recalc && node->active)
|
if (recalc_reason && node->active)
|
||||||
pw_context_recalc_graph(context, "quantum change");
|
pw_context_recalc_graph(context, recalc_reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *str_status(uint32_t status)
|
static const char *str_status(uint32_t status)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue