From 428cb5de75005300d7cf86cfb04aac4322badb70 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 24 May 2019 16:50:48 +0200 Subject: [PATCH] port: ignore not implemented mixer methods --- src/pipewire/control.c | 17 +++++++---------- src/pipewire/port.c | 11 +++++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pipewire/control.c b/src/pipewire/control.c index e76250ac6..92ce59179 100644 --- a/src/pipewire/control.c +++ b/src/pipewire/control.c @@ -141,22 +141,19 @@ void pw_control_add_listener(struct pw_control *control, static int port_set_io(struct pw_port *port, uint32_t mix, uint32_t id, void *data, uint32_t size) { - struct spa_node *n; - uint32_t p; int res; if (port->mix) { - n = port->mix; - p = mix; - } else { - n = port->node->node; - p = port->port_id; + res = spa_node_port_set_io(port->mix, port->direction, mix, id, data, size); + if (res == 0) + return res; } - if ((res = spa_node_port_set_io(n, - port->direction, p, + + if ((res = spa_node_port_set_io(port->node->node, + port->direction, port->port_id, id, data, size)) < 0) { pw_log_warn("port %p: set io failed %d %s", port, - res, spa_strerror(res)); + res, spa_strerror(res)); } return res; } diff --git a/src/pipewire/port.c b/src/pipewire/port.c index b77f40dad..34399df8c 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -179,7 +179,7 @@ int pw_port_init_mix(struct pw_port *port, struct pw_port_mix *mix) res = pw_port_call_init_mix(port, mix); /* set the same format on the mixer as on the port if any */ - if (1) { + { uint32_t idx = 0; uint8_t buffer[1024]; struct spa_pod_builder b; @@ -412,7 +412,7 @@ int pw_port_set_mix(struct pw_port *port, struct spa_node *node, uint32_t flags) struct impl *impl = SPA_CONTAINER_OF(port, struct impl, this); if (node == NULL) { - node = (struct spa_node *)&impl->mix_node; + node = &impl->mix_node; flags = 0; } pw_log_debug("port %p: mix node %p->%p", port, port->mix, node); @@ -959,7 +959,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t id, uint32_t flags, pw_log_debug("port %p: %d set param %d %p", port, port->state, id, param); /* set the parameters on all ports of the mixer node if possible */ - if (1) { + { struct pw_port_mix *mix; spa_list_for_each(mix, &port->mix_list, link) { @@ -1017,10 +1017,13 @@ int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id, if ((mix = pw_map_lookup(&port->mix_port_map, mix_id)) == NULL) return -EIO; - if (1) { + { res = spa_node_port_use_buffers(port->mix, mix->port.direction, mix->port.port_id, buffers, n_buffers); + if (res == -ENOTSUP) + res = 0; + pw_log_debug("port %p: use buffers on mix: %p %d (%s)", port, port->mix, res, spa_strerror(res)); }