]> git.0d.be Git - empathy.git/commitdiff
factor out start_call
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 11 Jan 2010 14:47:47 +0000 (14:47 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 11 Jan 2010 15:23:56 +0000 (15:23 +0000)
src/empathy-call-window.c

index d78016ac79103f3694f00e408a34bbbd0c74be90..564d904caf0121cf8e6137d67ed4b175e32feafd 100644 (file)
@@ -2052,6 +2052,15 @@ empathy_call_window_remove_video_input (EmpathyCallWindow *self)
   gtk_widget_show (priv->self_user_avatar_widget);
 }
 
+static void
+start_call (EmpathyCallWindow *self)
+{
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
+
+  priv->call_started = TRUE;
+  empathy_call_handler_start_call (priv->handler);
+  gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
+}
 
 static gboolean
 empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
@@ -2078,9 +2087,7 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
             gst_message_parse_state_changed (message, NULL, &newstate, NULL);
             if (newstate == GST_STATE_PAUSED)
               {
-                priv->call_started = TRUE;
-                empathy_call_handler_start_call (priv->handler);
-                gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
+                start_call (self);
               }
           }
         break;
@@ -2474,10 +2481,8 @@ empathy_call_window_restart_call (EmpathyCallWindow *window)
   priv->outgoing = TRUE;
   empathy_call_window_set_state_connecting (window);
 
-  priv->call_started = TRUE;
-  empathy_call_handler_start_call (priv->handler);
+  start_call (window);
   empathy_call_window_setup_avatars (window, priv->handler);
-  gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
 
   gtk_action_set_sensitive (priv->redial, FALSE);
   gtk_widget_set_sensitive (priv->redial_button, FALSE);