xvimagesink: don't recreate xvcontext

A xvcontext can be created early in gst_xvimagesink_set_window_handle().
In this case don't recreate, i.e. overwrite it in gst_xvimagesink_open().
Otherwise XEvents won't be handled in the xevent listener thread.

Fixes a regression when setting the window handle on the sink in
the very beginning before changing its state.

https://bugzilla.gnome.org/show_bug.cgi?id=715138
This commit is contained in:
Holger Kaelberer 2014-01-14 23:07:34 +01:00 committed by Sebastian Dröge
parent b532ce16a5
commit ae4338bd35

View file

@ -1728,17 +1728,20 @@ gst_xvimagesink_get_property (GObject * object, guint prop_id,
static gboolean static gboolean
gst_xvimagesink_open (GstXvImageSink * xvimagesink) gst_xvimagesink_open (GstXvImageSink * xvimagesink)
{ {
GstXvContext *context;
GError *error = NULL; GError *error = NULL;
/* Initializing the XvContext */ /* Initializing the XvContext unless already done through GstVideoOverlay */
if (!xvimagesink->context) {
GstXvContext *context;
if (!(context = gst_xvcontext_new (&xvimagesink->config, &error))) if (!(context = gst_xvcontext_new (&xvimagesink->config, &error)))
goto no_context; goto no_context;
GST_OBJECT_LOCK (xvimagesink); GST_OBJECT_LOCK (xvimagesink);
xvimagesink->context = context; xvimagesink->context = context;
} else
GST_OBJECT_LOCK (xvimagesink);
/* make an allocator for this context */ /* make an allocator for this context */
xvimagesink->allocator = gst_xvimage_allocator_new (context); xvimagesink->allocator = gst_xvimage_allocator_new (xvimagesink->context);
GST_OBJECT_UNLOCK (xvimagesink); GST_OBJECT_UNLOCK (xvimagesink);
/* update object's par with calculated one if not set yet */ /* update object's par with calculated one if not set yet */