From 018fdf36b1c7cff8cb5340322bfa63cee9388c44 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 15 Feb 2023 12:34:27 -0500 Subject: [PATCH] gtkwaylandsink: Force a redraw on resolution change As we don't render into the widget directly, there is no "initial" draw happening. As a side effect, the internal aspect ratio adapted display width/height is never initialize leading to assertions when handling navigation events. gst_video_center_rect: assertion 'src->h != 0' failed Simply queue a redraw after setting the widget format in order to fix the issue. Part-of: --- subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c b/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c index dc1e3c3bde..5288614bd7 100644 --- a/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c +++ b/subprojects/gst-plugins-bad/ext/gtk/gstgtkwaylandsink.c @@ -875,6 +875,12 @@ gst_gtk_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) GST_OBJECT_UNLOCK (self); return FALSE; } + + /* Ensure queue_draw get executed and internal display size get initialized. + * This does not happen otherwise as we don't draw in the widget + */ + gtk_gst_base_widget_queue_draw (GTK_GST_BASE_WIDGET (priv->gtk_widget)); + GST_OBJECT_UNLOCK (self); priv->use_dmabuf = use_dmabuf;