[empathy] Return a telepathy error if the source can't be added



commit b860ad599ff905a735ca00f4f256c43411c09a85
Author: Olivier Crête <olivier crete collabora co uk>
Date:   Sat Mar 6 18:27:56 2010 -0500

    Return a telepathy error if the source can't be added

 libempathy/empathy-call-handler.c |   11 ++++++++---
 src/empathy-call-window.c         |    3 ++-
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c
index 9cfee1d..31b66f3 100644
--- a/libempathy/empathy-call-handler.c
+++ b/libempathy/empathy-call-handler.c
@@ -238,8 +238,8 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass)
   signals[SINK_PAD_ADDED] =
     g_signal_new ("sink-pad-added", G_TYPE_FROM_CLASS (klass),
       G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-      _empathy_marshal_VOID__OBJECT_UINT,
-      G_TYPE_NONE,
+      _empathy_marshal_BOOLEAN__OBJECT_UINT,
+      G_TYPE_BOOLEAN,
       2, GST_TYPE_PAD, G_TYPE_UINT);
 
   signals[REQUEST_RESOURCE] =
@@ -375,6 +375,7 @@ empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
 {
   guint media_type;
   GstPad *spad;
+  gboolean retval;
 
   g_signal_connect (stream, "src-pad-added",
       G_CALLBACK (empathy_call_handler_tf_stream_src_pad_added_cb), handler);
@@ -388,7 +389,11 @@ empathy_call_handler_tf_channel_stream_created_cb (TfChannel *tfchannel,
     "sink-pad", &spad, NULL);
 
   g_signal_emit (G_OBJECT (handler), signals[SINK_PAD_ADDED], 0,
-    spad, media_type);
+      spad, media_type, &retval);
+
+ if (!retval)
+      tf_stream_error (stream, TP_MEDIA_STREAM_ERROR_MEDIA_ERROR,
+          "Could not link source");
 
   gst_object_unref (spad);
 }
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 2b3be11..2e1be50 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2116,7 +2116,7 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
   return TRUE;
 }
 
-static void
+static gboolean
 empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
   GstPad *sink, guint media_type, gpointer user_data)
 {
@@ -2148,6 +2148,7 @@ empathy_call_window_sink_added_cb (EmpathyCallHandler *handler,
         g_assert_not_reached ();
     }
 
+  return TRUE;
 }
 
 static void



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