impl-port: clear peer buffers in suspend

When we clear the buffers on an output port when we clear the port
format in suspend, also clear the buffers shared by the peer input
port mixers because else they would reference old stale buffers.

Fixes #2914
This commit is contained in:
Wim Taymans 2023-01-02 16:45:14 +01:00
parent 6b228944f7
commit 6116ef8484

View file

@ -1473,6 +1473,12 @@ int pw_impl_port_set_param(struct pw_impl_port *port, uint32_t id, uint32_t flag
port->added = false; port->added = false;
} }
/* setting the format always destroys the negotiated buffers */ /* setting the format always destroys the negotiated buffers */
if (port->direction == PW_DIRECTION_OUTPUT) {
struct pw_impl_link *l;
/* remove all buffers shared with an output port peer */
spa_list_for_each(l, &port->links, output_link)
pw_impl_port_use_buffers(l->input, &l->rt.in_mix, 0, NULL, 0);
}
pw_buffers_clear(&port->buffers); pw_buffers_clear(&port->buffers);
pw_buffers_clear(&port->mix_buffers); pw_buffers_clear(&port->mix_buffers);