From e43d2a35fa671c18dd8bae39ab21df9671b5f0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 14 May 2024 18:02:07 +0000 Subject: gstreamer: Use copied camera name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The camera name is copied in gst_libcamera_src_open() as we can't hold the lock protecting the name while calling GST_ELEMENT_ERROR(). The GST_ELEMENT_ERROR() macro sends a message on the bus, taking more locks and possibly causing issues. However, the current code makes the copy, but does not actually use it. So fix that. Fixes: 58feb69f852289 ("gst: libcamerasrc: Implement selection and acquisition") Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Nicolas Dufresne Signed-off-by: Laurent Pinchart --- src/gstreamer/gstlibcamerasrc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gstreamer') diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index c0f4d506..6a95b6af 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -377,10 +377,10 @@ gst_libcamera_src_open(GstLibcameraSrc *self) } if (camera_name) { - cam = cm->get(self->camera_name); + cam = cm->get(camera_name); if (!cam) { GST_ELEMENT_ERROR(self, RESOURCE, NOT_FOUND, - ("Could not find a camera named '%s'.", self->camera_name), + ("Could not find a camera named '%s'.", camera_name), ("libcamera::CameraMananger::get() returned nullptr")); return false; } -- cgit v1.2.1