diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-08-06 17:58:42 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-08-06 17:58:42 +0200 |
commit | 46b8b67ee6559911e4b50098c9a212496d5e3d47 (patch) | |
tree | 58570b280d62963fd99675c4bbcef83b216528ac | |
parent | 7cdef8aa32f5b387be32609281df4f6555359ae3 (diff) |
policy-node: small cleanup
to keep the orinal node around if we want to do something with it
later
-rw-r--r-- | src/examples/media-session/policy-node.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/examples/media-session/policy-node.c b/src/examples/media-session/policy-node.c index ca54bf6a..9d6e2568 100644 --- a/src/examples/media-session/policy-node.c +++ b/src/examples/media-session/policy-node.c @@ -442,6 +442,7 @@ static int link_nodes(struct node *node, struct node *peer) { struct impl *impl = node->impl; struct pw_properties *props; + struct node *output, *input; 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; if (node->direction == PW_DIRECTION_INPUT) { - struct node *t = node; - node = peer; - peer = t; + output = peer; + input = node; + } else { + output = node; + input = peer; } - 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_INPUT_NODE, "%d", peer->id); - pw_log_info("linking node %d to node %d", node->id, peer->id); + pw_properties_setf(props, PW_KEY_LINK_OUTPUT_NODE, "%d", output->id); + pw_properties_setf(props, PW_KEY_LINK_INPUT_NODE, "%d", input->id); + pw_log_info("linking node %d to node %d", output->id, input->id); sm_media_session_create_links(impl->session, &props->dict); |