From b8040b35c1a465d189f1573bc3521d4faaf70621 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 25 Jul 2014 17:29:40 +0200 Subject: [PATCH] window: make gst_vaapi_window_reconfigure() thread-safe. Ensure the X11 implementation for GstVaapiWindow::get_geometry() is thread-safe by default, so that upper layer users don't need to handle that explicitly. --- gst-libs/gst/vaapi/gstvaapiwindow_x11.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c index 20470ed..776c7d8 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c @@ -295,8 +295,12 @@ gst_vaapi_window_x11_get_geometry (GstVaapiWindow * window, { Display *const dpy = GST_VAAPI_OBJECT_XDISPLAY (window); const Window xid = GST_VAAPI_OBJECT_ID (window); + gboolean success; - return x11_get_geometry (dpy, xid, px, py, pwidth, pheight, NULL); + GST_VAAPI_OBJECT_LOCK_DISPLAY (window); + success = x11_get_geometry (dpy, xid, px, py, pwidth, pheight, NULL); + GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window); + return success; } static gboolean -- 2.7.4