mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: libcamera: source: add eventfd to loop while locked
While concurrent `spa_loop_add_source()` invocations work with the current main epoll-based implementation, this is not guaranteed, so lock the loop. Similarly to how it is done elsewhere and for removal already.
This commit is contained in:
parent
1f60cd291f
commit
507688e6c9
1 changed files with 10 additions and 1 deletions
|
|
@ -1350,7 +1350,16 @@ int spa_libcamera_stream_on(struct impl *impl)
|
|||
impl->source.data = impl;
|
||||
impl->source.mask = SPA_IO_IN | SPA_IO_ERR;
|
||||
impl->source.rmask = 0;
|
||||
res = spa_loop_add_source(impl->data_loop, &impl->source);
|
||||
|
||||
res = spa_loop_locked(
|
||||
impl->data_loop,
|
||||
[](spa_loop *, bool, uint32_t, const void *, size_t, void *user_data)
|
||||
{
|
||||
auto *impl = static_cast<struct impl *>(user_data);
|
||||
return spa_loop_add_source(impl->data_loop, &impl->source);
|
||||
},
|
||||
0, nullptr, 0, impl
|
||||
);
|
||||
if (res < 0)
|
||||
goto err_close_source;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue