port: don't try to negotiate 0 buffers

Don't try to negotiate buffers when we are clearing the buffers.
This commit is contained in:
Wim Taymans 2020-02-27 13:39:59 +01:00
parent d39dbceb2a
commit 09186844c4

View file

@ -1208,17 +1208,19 @@ static int negotiate_mixer_buffers(struct pw_impl_port *port, uint32_t flags,
pw_buffers_clear(&port->mix_buffers); pw_buffers_clear(&port->mix_buffers);
if ((res = pw_buffers_negotiate(node->context, alloc_flags, if (n_buffers > 0) {
port->mix, 0, if ((res = pw_buffers_negotiate(node->context, alloc_flags,
node->node, port->port_id, port->mix, 0,
&port->mix_buffers)) < 0) { node->node, port->port_id,
pw_log_warn(NAME" %p: can't negotiate buffers: %s", &port->mix_buffers)) < 0) {
port, spa_strerror(res)); pw_log_warn(NAME" %p: can't negotiate buffers: %s",
return res; port, spa_strerror(res));
return res;
}
buffers = port->mix_buffers.buffers;
n_buffers = port->mix_buffers.n_buffers;
flags = 0;
} }
buffers = port->mix_buffers.buffers;
n_buffers = port->mix_buffers.n_buffers;
flags = 0;
} }
pw_log_debug(NAME" %p: %d.%d use buffers on node: %p", pw_log_debug(NAME" %p: %d.%d use buffers on node: %p",