From 14e0a8f66ff009c1d486c0532a39737f4e07f017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 8 Aug 2025 10:38:25 +0200 Subject: [PATCH] spa: libcamera: source: propagate error when setting format If `spa_libcamera_set_format()` fails, propagate its return value as is without rewriting it to `EINVAL`. --- spa/plugins/libcamera/libcamera-source.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spa/plugins/libcamera/libcamera-source.cpp b/spa/plugins/libcamera/libcamera-source.cpp index 524afef7b..4f9816c46 100644 --- a/spa/plugins/libcamera/libcamera-source.cpp +++ b/spa/plugins/libcamera/libcamera-source.cpp @@ -1894,8 +1894,9 @@ int port_set_format(struct impl *impl, struct port *port, port->current_format.reset(); } - if (spa_libcamera_set_format(impl, port, &info, flags & SPA_NODE_PARAM_FLAG_TEST_ONLY) < 0) - return -EINVAL; + res = spa_libcamera_set_format(impl, port, &info, flags & SPA_NODE_PARAM_FLAG_TEST_ONLY); + if (res < 0) + return res; if (!(flags & SPA_NODE_PARAM_FLAG_TEST_ONLY)) { port->current_format = info;