From 7d4079b28586504d93976ca352c71b76ca5b294e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 28 Mar 2025 16:00:51 +0100 Subject: [PATCH] v4l2: handle nearest set_format The set_format function can return 1 when the format was adjusted to the nearest supported format so return this from the port_set_param function. This instructs the adapter to recheck the configured format so that it can store the adjuted format on the converter. --- spa/plugins/v4l2/v4l2-source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index 899a566c2..0466764a3 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -664,7 +664,7 @@ static int port_set_format(struct impl *this, struct port *port, const struct spa_pod *format) { struct spa_video_info info; - int res; + int res = 0; spa_zero(info); @@ -744,7 +744,7 @@ static int port_set_format(struct impl *this, struct port *port, emit_port_info(this, port, false); emit_node_info(this, false); - return 0; + return res; } static int impl_node_port_set_param(void *object,