[empathy] dup_color_balance: check that element currently implements GstColorBalance



commit c785ff79365fb91a41e38458ae6ea5cf02cbaa8f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Sep 9 13:45:31 2011 +0200

    dup_color_balance: check that element currently implements GstColorBalance
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658584

 src/empathy-video-src.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c
index da86eda..ca8370d 100644
--- a/src/empathy-video-src.c
+++ b/src/empathy-video-src.c
@@ -256,6 +256,15 @@ dup_color_balance (GstElement *src)
   if (color == NULL)
     return NULL;
 
+  /* colorbalance is wrapped by GstImplementsInterface, we
+   * need to check if it is actually supported for this instance
+   * in its current state before trying to use it */
+  if (!GST_IS_COLOR_BALANCE (color))
+    {
+      g_object_unref (color);
+      return NULL;
+    }
+
   return GST_COLOR_BALANCE (color);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]