spa: libcamera: source: handle camera acquire failure

Check the return value of `Camera::acquire()` and return the error
if that fails.

(cherry picked from commit f53ac8d57c)
This commit is contained in:
Barnabás Pőcze 2025-07-12 18:24:44 +02:00 committed by Robert Mader
parent a233905f75
commit 3dd413e131

View file

@ -212,7 +212,9 @@ int spa_libcamera_open(struct impl *impl)
return 0; return 0;
spa_log_info(impl->log, "open camera %s", impl->device_id.c_str()); spa_log_info(impl->log, "open camera %s", impl->device_id.c_str());
impl->camera->acquire();
if (int res = impl->camera->acquire(); res < 0)
return res;
impl->allocator = new FrameBufferAllocator(impl->camera); impl->allocator = new FrameBufferAllocator(impl->camera);