diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2025-01-06 10:06:16 +0000 |
---|---|---|
committer | Barnabás Pőcze <pobrn@protonmail.com> | 2025-01-10 12:14:27 +0100 |
commit | fd6e41b9fb32b54f6811898f824fe50b918d82eb (patch) | |
tree | 94c6257a1583620cf6c1eeaf0d5e20154ebd4289 | |
parent | d49a84a4f3aa63efc900564ff32558e4f5d85b04 (diff) |
gstreamer: allocator: gst_libcamera_allocator_new(): Recognize errors
`FrameBufferAllocator::allocate()` might return a negative error code,
but currently this is handled the same way as success. So instead
of continuing, abort the construction of the allocator object.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
-rw-r--r-- | src/gstreamer/gstlibcameraallocator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp index 7e4c904d..b0c84893 100644 --- a/src/gstreamer/gstlibcameraallocator.cpp +++ b/src/gstreamer/gstlibcameraallocator.cpp @@ -214,7 +214,7 @@ gst_libcamera_allocator_new(std::shared_ptr<Camera> camera, Stream *stream = streamCfg.stream(); ret = self->fb_allocator->allocate(stream); - if (ret == 0) + if (ret <= 0) return nullptr; GQueue *pool = g_queue_new(); |