summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Kaelberer <hk@getslash.de>2014-01-14 23:07:34 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-01-15 11:06:09 +0100
commitae4338bd35d8aee3ecf1e5f5e24a5a51e914881d (patch)
treeb8336a63b659bfd5f5e41918e1adb5258ff67ada
parentb532ce16a52dfc7e1a806ed559aab5d77735dcd8 (diff)
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
-rw-r--r--sys/xvimage/xvimagesink.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c
index eddd75748..30e7538cf 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 */