mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-28 01:40:43 -05:00
spa: libcamera: source: fix stop sequence
Currently it is possible for the request completion handler (`impl::requestComplete`)
to observe `impl::source.fd` while it is being modified in `impl::stop()`.
Fix that by closing the eventfd after the camera has been stopped.
Fixes: 3e28f3e859 ("spa: libcamera: source: rework startup sequence")
This commit is contained in:
parent
6961bfeaa1
commit
848ac24490
1 changed files with 3 additions and 3 deletions
|
|
@ -184,9 +184,6 @@ struct impl {
|
|||
0, nullptr, 0, this
|
||||
);
|
||||
|
||||
if (source.fd >= 0)
|
||||
spa_system_close(system, std::exchange(source.fd, -1));
|
||||
|
||||
camera->requestCompleted.disconnect(this, &impl::requestComplete);
|
||||
|
||||
if (int res = camera->stop(); res < 0) {
|
||||
|
|
@ -194,6 +191,9 @@ struct impl {
|
|||
camera->id().c_str(), spa_strerror(res));
|
||||
}
|
||||
|
||||
if (source.fd >= 0)
|
||||
spa_system_close(system, std::exchange(source.fd, -1));
|
||||
|
||||
completed_requests_rb = SPA_RINGBUFFER_INIT();
|
||||
active = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue