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:
Stefan Kost 2010-04-15 12:59:53 +03:00
parent 656573757e
commit 6c51803dc8
2 changed files with 8 additions and 2 deletions

View file

@ -922,10 +922,13 @@ gst_ximagesink_xwindow_update_geometry (GstXImageSink * ximagesink)
XWindowAttributes attr;
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
g_return_if_fail (ximagesink->xwindow != NULL);
/* Update the window geometry */
g_mutex_lock (ximagesink->x_lock);
if (G_UNLIKELY (ximagesink->xwindow == NULL)) {
g_mutex_unlock (ximagesink->x_lock);
return;
}
XGetWindowAttributes (ximagesink->xcontext->disp,
ximagesink->xwindow->win, &attr);

View file

@ -1048,10 +1048,13 @@ gst_xvimagesink_xwindow_update_geometry (GstXvImageSink * xvimagesink)
XWindowAttributes attr;
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
g_return_if_fail (xvimagesink->xwindow != NULL);
/* Update the window geometry */
g_mutex_lock (xvimagesink->x_lock);
if (G_UNLIKELY (xvimagesink->xwindow == NULL)) {
g_mutex_unlock (xvimagesink->x_lock);
return;
}
XGetWindowAttributes (xvimagesink->xcontext->disp,
xvimagesink->xwindow->win, &attr);