From: Holger Kaelberer Date: Tue, 14 Jan 2014 22:07:34 +0000 (+0100) Subject: xvimagesink: don't recreate xvcontext X-Git-Tag: 1.19.3~511^2~4767 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae4338bd35d8aee3ecf1e5f5e24a5a51e914881d;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index eddd757485..30e7538cf1 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 */