pw-cli: allow '-' for port/node in create-link

Passing a '-' as the port or node for create-link will omit sending
the property to create-link so we can check if the link factory handles
missing properties too.

See #1365
This commit is contained in:
Wim Taymans 2021-06-30 11:52:57 +02:00
parent 27b9f469b5
commit 2c5d89ff19

View file

@ -1387,10 +1387,14 @@ static bool do_create_link(struct data *data, const char *cmd, char *args, char
else
props = pw_properties_new(NULL, NULL);
pw_properties_set(props, PW_KEY_LINK_OUTPUT_NODE, a[0]);
pw_properties_set(props, PW_KEY_LINK_OUTPUT_PORT, a[1]);
pw_properties_set(props, PW_KEY_LINK_INPUT_NODE, a[2]);
pw_properties_set(props, PW_KEY_LINK_INPUT_PORT, a[3]);
if (!spa_streq(a[0], "-"))
pw_properties_set(props, PW_KEY_LINK_OUTPUT_NODE, a[0]);
if (!spa_streq(a[1], "-"))
pw_properties_set(props, PW_KEY_LINK_OUTPUT_PORT, a[1]);
if (!spa_streq(a[2], "-"))
pw_properties_set(props, PW_KEY_LINK_INPUT_NODE, a[2]);
if (!spa_streq(a[3], "-"))
pw_properties_set(props, PW_KEY_LINK_INPUT_PORT, a[3]);
proxy = (struct pw_proxy*)pw_core_create_object(rd->core,
"link-factory",