From ae4338bd35d8aee3ecf1e5f5e24a5a51e914881d Mon Sep 17 00:00:00 2001 From: Holger Kaelberer Date: Tue, 14 Jan 2014 23:07:34 +0100 Subject: [PATCH] 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 --- sys/xvimage/xvimagesink.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index eddd757..30e7538 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1728,17 +1728,20 @@ gst_xvimagesink_get_property (GObject * object, guint prop_id, static gboolean gst_xvimagesink_open (GstXvImageSink * xvimagesink) { - GstXvContext *context; GError *error = NULL; - /* Initializing the XvContext */ - if (!(context = gst_xvcontext_new (&xvimagesink->config, &error))) - goto no_context; + /* Initializing the XvContext unless already done through GstVideoOverlay */ + if (!xvimagesink->context) { + GstXvContext *context; + if (!(context = gst_xvcontext_new (&xvimagesink->config, &error))) + goto no_context; - GST_OBJECT_LOCK (xvimagesink); - xvimagesink->context = context; + GST_OBJECT_LOCK (xvimagesink); + xvimagesink->context = context; + } else + GST_OBJECT_LOCK (xvimagesink); /* 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); /* update object's par with calculated one if not set yet */ -- 2.7.4