diff options
author | David Bender <benderdave@gitlab.fdo> | 2020-06-12 00:21:56 +0200 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-09-25 14:23:45 +0000 |
commit | 7a872379c9f2b09719b350a2d01897cc25b3ce74 (patch) | |
tree | dd6d82c975b1d0dc09e8f7621316a9caedbc5206 | |
parent | 24be5f386017fabf2e69dc241485840d42bbe38d (diff) | |
download | gstreamer-plugins-base-7a872379c9f2b09719b350a2d01897cc25b3ce74.tar.gz |
gstglwindow_x11: fix resize
This patch was taken from #629#note_178766, the comment made
at the time was:
The root issue is a mismatch between the initialization of render_rect
in GstGLWindowX11Private and what's expected in the draw_cb function.
Because render_rect is not explicitly initialized to a width and height
of -1 (unlike gstglwindow_wayland_egl.c which does initialize to -1),
the less-than check for explicitly-set render_rect at gstglwindow_x11.c:453-454
always fails, even when the parent_win has been set and the render rectangle
has never been set.
Maybe this came from copying the similar check in the wayland code? Regardless,
I think the correct inequality should be '<= 0' (on both lines).
Alternatively initialization could be changed, but other sinks, e.g.
xvimagesink don't appear to use -1 to mean "unset" render_rect this way.
The issue can be reproduced by running the example in
tests/examples/gl/qt/videooverlay/ on X11, and resizing the output
window
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/829>
-rw-r--r-- | gst-libs/gst/gl/x11/gstglwindow_x11.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c index 5cbf46a6b..960d39fb8 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c @@ -450,8 +450,8 @@ draw_cb (gpointer data) GST_TRACE_OBJECT (window, "window size %ux%u", attr.width, attr.height); if (window_x11->parent_win && - (window_x11->priv->render_rect.w < 0 || - window_x11->priv->render_rect.h < 0)) { + (window_x11->priv->render_rect.w <= 0 || + window_x11->priv->render_rect.h <= 0)) { XWindowAttributes attr_parent; XGetWindowAttributes (window_x11->device, window_x11->parent_win, &attr_parent); |