]> git.0d.be Git - empathy.git/commitdiff
manually build the GstStructure
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Aug 2011 13:13:27 +0000 (15:13 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 15 Aug 2011 13:13:27 +0000 (15:13 +0200)
libempathy-gtk/empathy-call-utils.c

index c5e88ec80b634f88d7d5e9bb2607eeddf82456a9..eb01fe25bcc0fb3332a3a3b4ae14eea50ddb7785 100644 (file)
@@ -23,6 +23,7 @@
 #include <glib/gi18n.h>
 
 #include <gtk/gtk.h>
+#include <pulse/pulseaudio.h>
 
 #include <telepathy-glib/telepathy-glib.h>
 
@@ -200,20 +201,25 @@ empathy_call_set_stream_properties (GstElement *element)
   GstStructure *props;
   GSettings *gsettings_call;
   gboolean echo_cancellation;
-  gchar *tmp;
 
   gsettings_call = g_settings_new (EMPATHY_PREFS_CALL_SCHEMA);
 
   echo_cancellation = g_settings_get_boolean (gsettings_call,
       EMPATHY_PREFS_CALL_ECHO_CANCELLATION);
 
-  tmp = g_strdup_printf ("props,media.role=phone%s", echo_cancellation ?
-      ",filter.want=echo-cancel": "");
+  props = gst_structure_new ("props",
+      PA_PROP_MEDIA_ROLE, G_TYPE_STRING, "phone",
+      NULL);
+
+  if (echo_cancellation)
+    {
+      gst_structure_set (props,
+          "filter.want", G_TYPE_STRING, "echo-cancel",
+          NULL);
+    }
 
-  props = gst_structure_from_string (tmp, NULL);
   g_object_set (element, "stream-properties", props, NULL);
   gst_structure_free (props);
 
-  g_free (tmp);
   g_object_unref (gsettings_call);
 }