mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
port: just number unknown channels
Ports with unknown channel layout are just numbered.
This commit is contained in:
parent
6590d3a258
commit
a086fc5c0c
2 changed files with 14 additions and 6 deletions
|
|
@ -171,6 +171,7 @@ static void node_port_init(void *data, struct pw_port *port)
|
||||||
void *iface;
|
void *iface;
|
||||||
const struct spa_support *support;
|
const struct spa_support *support;
|
||||||
uint32_t n_support;
|
uint32_t n_support;
|
||||||
|
char position[8];
|
||||||
|
|
||||||
direction = pw_port_get_direction(port);
|
direction = pw_port_get_direction(port);
|
||||||
if (direction == n->direction)
|
if (direction == n->direction)
|
||||||
|
|
@ -184,7 +185,13 @@ static void node_port_init(void *data, struct pw_port *port)
|
||||||
"port.terminal", "1",
|
"port.terminal", "1",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if ((str = pw_properties_get(old, "port.channel")) != NULL)
|
if ((str = pw_properties_get(old, "port.channel")) == NULL ||
|
||||||
|
strcmp(str, "UNK") == 0) {
|
||||||
|
snprintf(position, 7, "%d", port->port_id);
|
||||||
|
str = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pw_properties_setf(new, "port.name", "%s_%s",
|
pw_properties_setf(new, "port.name", "%s_%s",
|
||||||
direction == PW_DIRECTION_INPUT ? "playback" : "capture",
|
direction == PW_DIRECTION_INPUT ? "playback" : "capture",
|
||||||
str);
|
str);
|
||||||
|
|
@ -193,7 +200,7 @@ static void node_port_init(void *data, struct pw_port *port)
|
||||||
pw_properties_get(n->props, "device.api"),
|
pw_properties_get(n->props, "device.api"),
|
||||||
pw_properties_get(n->props, "device.name"),
|
pw_properties_get(n->props, "device.name"),
|
||||||
direction == PW_DIRECTION_INPUT ? "in" : "out",
|
direction == PW_DIRECTION_INPUT ? "in" : "out",
|
||||||
str ? str : "UNK");
|
str);
|
||||||
|
|
||||||
pw_port_update_properties(port, &new->dict);
|
pw_port_update_properties(port, &new->dict);
|
||||||
pw_properties_free(new);
|
pw_properties_free(new);
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,8 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((str = pw_properties_get(port->properties, "port.name")) == NULL) {
|
if ((str = pw_properties_get(port->properties, "port.name")) == NULL) {
|
||||||
if ((str = pw_properties_get(port->properties, "port.channel")) != NULL) {
|
if ((str = pw_properties_get(port->properties, "port.channel")) != NULL &&
|
||||||
|
strcmp(str, "UNK") != 0) {
|
||||||
pw_properties_setf(port->properties, "port.name", "%s_%s", dir, str);
|
pw_properties_setf(port->properties, "port.name", "%s_%s", dir, str);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue