From b24e2ea68e34a1b00298d818af594f656d4bdf47 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Wed, 10 Nov 2021 14:21:08 +0000 Subject: [PATCH] ci: Fix compile error using new GStreamer library Using Fedora 35 the compilation fails due to this warning: ../server/gstreamer-encoder.c: In function 'create_pipeline': ../server/gstreamer-encoder.c:994:5: error: braces around scalar initializer [-Werror] 994 | GstAppSinkCallbacks appsink_cbs = {NULL, NULL, &new_sample, {NULL}}; | ^~~~~~~~~~~~~~~~~~~ ../server/gstreamer-encoder.c:994:5: note: (near initialization for 'appsink_cbs.new_event') ../server/gstreamer-encoder.c:994:5: error: missing initializer for field '_gst_reserved' of 'GstAppSinkCallbacks' [-Werror=missing-field-initializers] In file included from ../server/gstreamer-encoder.c:26: /usr/include/gstreamer-1.0/gst/app/gstappsink.h:81:16: note: '_gst_reserved' declared here 81 | gpointer _gst_reserved[GST_PADDING - 1]; | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors Change structure initialisation to avoid the warning. The same syntax is already used in server/tests/test-gst.cpp. Signed-off-by: Frediano Ziglio --- server/gstreamer-encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c index 973a5f3..5ea11f4 100644 --- a/server/gstreamer-encoder.c +++ b/server/gstreamer-encoder.c @@ -991,7 +991,7 @@ static gboolean create_pipeline(SpiceGstEncoder *encoder) #ifdef HAVE_GSTREAMER_0_10 GstAppSinkCallbacks appsink_cbs = {NULL, NULL, &new_sample, NULL, {NULL}}; #else - GstAppSinkCallbacks appsink_cbs = {NULL, NULL, &new_sample, {NULL}}; + GstAppSinkCallbacks appsink_cbs = {NULL, NULL, &new_sample, ._gst_reserved={NULL}}; #endif gst_app_sink_set_callbacks(encoder->appsink, &appsink_cbs, encoder, NULL); -- libgit2 1.3.0