From 02f2d6b48da6759f66b83e68a9ffe23b4c34acd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 4 Sep 2022 03:48:51 +0200 Subject: [PATCH] spa: libcamera: remove unnecessary `have_config` member An extra flag is not needed because the `config` pointer can be checked to determine if a configuration has already been retrieved. --- spa/plugins/libcamera/libcamera-source.cpp | 1 - spa/plugins/libcamera/libcamera-utils.cpp | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/spa/plugins/libcamera/libcamera-source.cpp b/spa/plugins/libcamera/libcamera-source.cpp index de28a047b..04e4724d5 100644 --- a/spa/plugins/libcamera/libcamera-source.cpp +++ b/spa/plugins/libcamera/libcamera-source.cpp @@ -171,7 +171,6 @@ typedef struct impl { void requestComplete(libcamera::Request *request); - unsigned int have_config; std::unique_ptr config; struct spa_source source = {}; diff --git a/spa/plugins/libcamera/libcamera-utils.cpp b/spa/plugins/libcamera/libcamera-utils.cpp index 8fafbce8a..ff1f5ca91 100644 --- a/spa/plugins/libcamera/libcamera-utils.cpp +++ b/spa/plugins/libcamera/libcamera-utils.cpp @@ -69,13 +69,12 @@ int spa_libcamera_close(struct impl *impl) static void spa_libcamera_get_config(struct impl *impl) { - if (impl->have_config) + if (impl->config) return; StreamRoles roles; roles.push_back(VideoRecording); impl->config = impl->camera->generateConfiguration(roles); - impl->have_config = true; } static int spa_libcamera_buffer_recycle(struct impl *impl, struct port *port, uint32_t buffer_id)