sink the videosink so we can hold a ref to it
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 3 Feb 2009 09:03:39 +0000 (09:03 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 3 Feb 2009 09:03:39 +0000 (09:03 +0000)
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2397

libempathy-gtk/empathy-video-widget.c

index 7941b3198b19e84acd7f1d23cdb17f4763fced48..3723f50d310c182af2c0f2fb8e9c508f8b450241 100644 (file)
@@ -90,6 +90,9 @@ empathy_video_widget_constructed (GObject *object)
   EmpathyVideoWidgetPriv *priv = GET_PRIV (object);
 
   priv->videosink = gst_element_factory_make ("gconfvideosink", NULL);
+  gst_object_ref (priv->videosink);
+  gst_object_sink (priv->videosink);
+
   priv->sink_pad = gst_element_get_static_pad (priv->videosink, "sink");
 
   fs_element_added_notifier_add (priv->notifier, GST_BIN (priv->videosink));
@@ -192,6 +195,12 @@ empathy_video_widget_dispose (GObject *object)
 
   priv->bus = NULL;
 
+  if (priv->videosink != NULL)
+    g_object_unref (priv->videosink);
+
+  priv->videosink = NULL;
+
+
   /* release any references held by the object here */
 
   if (G_OBJECT_CLASS (empathy_video_widget_parent_class)->dispose)