mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
x(v)imagesink: gracefully handle ximagesink>xwindow == NULL
Expose could be called before we have set the xwindow. Handle this gracefully like we do in image_put. Fixes #615789
This commit is contained in:
parent
656573757e
commit
6c51803dc8
2 changed files with 8 additions and 2 deletions
|
@ -922,10 +922,13 @@ gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink)
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
|
||||||
g_return_if_fail (ximagesink->xwindow != NULL);
|
|
||||||
|
|
||||||
/* Update the window geometry */
|
/* Update the window geometry */
|
||||||
g_mutex_lock (ximagesink->x_lock);
|
g_mutex_lock (ximagesink->x_lock);
|
||||||
|
if (G_UNLIKELY (ximagesink->xwindow == NULL)) {
|
||||||
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
XGetWindowAttributes (ximagesink->xcontext->disp,
|
XGetWindowAttributes (ximagesink->xcontext->disp,
|
||||||
ximagesink->xwindow->win, &attr);
|
ximagesink->xwindow->win, &attr);
|
||||||
|
|
|
@ -1048,10 +1048,13 @@ gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink)
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
|
||||||
g_return_if_fail (xvimagesink->xwindow != NULL);
|
|
||||||
|
|
||||||
/* Update the window geometry */
|
/* Update the window geometry */
|
||||||
g_mutex_lock (xvimagesink->x_lock);
|
g_mutex_lock (xvimagesink->x_lock);
|
||||||
|
if (G_UNLIKELY (xvimagesink->xwindow == NULL)) {
|
||||||
|
g_mutex_unlock (xvimagesink->x_lock);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
XGetWindowAttributes (xvimagesink->xcontext->disp,
|
XGetWindowAttributes (xvimagesink->xcontext->disp,
|
||||||
xvimagesink->xwindow->win, &attr);
|
xvimagesink->xwindow->win, &attr);
|
||||||
|
|
Loading…
Reference in a new issue