mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
policy-node: small cleanup
to keep the orinal node around if we want to do something with it later
This commit is contained in:
parent
7cdef8aa32
commit
46b8b67ee6
1 changed files with 9 additions and 7 deletions
|
|
@ -442,6 +442,7 @@ static int link_nodes(struct node *node, struct node *peer)
|
||||||
{
|
{
|
||||||
struct impl *impl = node->impl;
|
struct impl *impl = node->impl;
|
||||||
struct pw_properties *props;
|
struct pw_properties *props;
|
||||||
|
struct node *output, *input;
|
||||||
|
|
||||||
pw_log_debug(NAME " %p: link nodes %d %d", impl, node->id, peer->id);
|
pw_log_debug(NAME " %p: link nodes %d %d", impl, node->id, peer->id);
|
||||||
|
|
||||||
|
|
@ -468,15 +469,16 @@ static int link_nodes(struct node *node, struct node *peer)
|
||||||
node->peer = peer;
|
node->peer = peer;
|
||||||
|
|
||||||
if (node->direction == PW_DIRECTION_INPUT) {
|
if (node->direction == PW_DIRECTION_INPUT) {
|
||||||
struct node *t = node;
|
output = peer;
|
||||||
node = peer;
|
input = node;
|
||||||
peer = t;
|
} else {
|
||||||
|
output = node;
|
||||||
|
input = peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
props = pw_properties_new(NULL, NULL);
|
props = pw_properties_new(NULL, NULL);
|
||||||
pw_properties_setf(props, PW_KEY_LINK_OUTPUT_NODE, "%d", node->id);
|
pw_properties_setf(props, PW_KEY_LINK_OUTPUT_NODE, "%d", output->id);
|
||||||
pw_properties_setf(props, PW_KEY_LINK_INPUT_NODE, "%d", peer->id);
|
pw_properties_setf(props, PW_KEY_LINK_INPUT_NODE, "%d", input->id);
|
||||||
pw_log_info("linking node %d to node %d", node->id, peer->id);
|
pw_log_info("linking node %d to node %d", output->id, input->id);
|
||||||
|
|
||||||
sm_media_session_create_links(impl->session, &props->dict);
|
sm_media_session_create_links(impl->session, &props->dict);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue