mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-12 05:34:05 -04:00
impl-link: fix shared mem test
We can only use non-shared memory when both nodes live in the same process _and_ we can be sure the output port is never going to be linked to a remote node because it is exclusive. This fixes the case where a null-sink is loaded inside the process space of the server and linked to the ALSA sink. This would create a link without shared mem and then as soon as something else (out of process) wants to link to the null-sink output, it would get a -22 EINVAL negotiation error because the memory can't be shared. Fixes #5159
This commit is contained in:
parent
6f73e42d05
commit
231a41a22f
1 changed files with 4 additions and 1 deletions
|
|
@ -701,7 +701,10 @@ static int do_allocation(struct pw_impl_link *this)
|
|||
/* always enable async mode */
|
||||
alloc_flags = PW_BUFFERS_FLAG_ASYNC;
|
||||
|
||||
if (output->node->remote || input->node->remote)
|
||||
/* shared mem can only be used if both nodes are in the same process
|
||||
* and we are sure that the buffers are never going to be shared
|
||||
* because of the exclusive flag */
|
||||
if (output->node->remote || input->node->remote || !output->exclusive)
|
||||
alloc_flags |= PW_BUFFERS_FLAG_SHARED;
|
||||
|
||||
if (output->node->driver)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue