Get node_from, node_to ids from state instead of props when a new link appears.

This is more reliable than assuming the link carries the id of its nodes, as there have been cases where a link was created without those
properties set.
Instead, we can just pull them from the state via the port ids of the link.
This commit is contained in:
Tom A. Wagner
2021-06-04 10:30:31 +02:00
parent a9aec985b0
commit 118c1ca28c
3 changed files with 44 additions and 24 deletions

View File

@@ -37,7 +37,11 @@ enum PipewireMessage {
direction: Direction,
},
/// A new link has appeared.
LinkAdded { id: u32, link: PipewireLink },
LinkAdded {
id: u32,
port_from: u32,
port_to: u32,
},
/// An object was removed
ObjectRemoved { id: u32 },
}