mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-26 07:58:03 -04: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") (cherry picked from commit848ac24490)
This commit is contained in:
parent
700cea78db
commit
87d1206fb8
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