aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-call-window.c
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-16 03:06:20 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:20:07 +0800
commit7992d97253ff1cecb4281191d0af459799ce9a21 (patch)
tree49d0f3cf58d13e91d7ae335025f6d182a5d17910 /src/empathy-call-window.c
parent6786331e5d8411c48e0b2700cb20c434add2845d (diff)
downloadgsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.tar
gsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.tar.gz
gsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.tar.bz2
gsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.tar.lz
gsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.tar.xz
gsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.tar.zst
gsoc2013-empathy-7992d97253ff1cecb4281191d0af459799ce9a21.zip
Don't start the Call when the streams start
Since that can happen before the call is accepted. Instead of that, wait for the Call state to be ACCEPTED. Conflicts: src/empathy-call-window.c
Diffstat (limited to 'src/empathy-call-window.c')
-rw-r--r--src/empathy-call-window.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index aa8bd5dcd..fac874c91 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2302,16 +2302,25 @@ empathy_call_window_video_stream_error (TpyCallChannel *call,
}
#endif
-static gboolean
-empathy_call_window_connected (gpointer user_data)
+static void
+empathy_call_window_state_changed_cb (EmpathyCallHandler *handler,
+ TpyCallState state,
+ EmpathyCallWindow *self)
{
- EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
EmpathyCallWindowPriv *priv = GET_PRIV (self);
TpyCallChannel *call;
gboolean can_send_video;
- empathy_sound_manager_stop (priv->sound_mgr, EMPATHY_SOUND_PHONE_OUTGOING);
+ if (state != TPY_CALL_STATE_ACCEPTED)
+ return;
+
+ if (priv->call_state == CONNECTED)
+ return;
+ g_timer_start (priv->timer);
+ priv->call_state = CONNECTED;
+
+ empathy_sound_manager_stop (priv->sound_mgr, EMPATHY_SOUND_PHONE_OUTGOING);
can_send_video = priv->video_input != NULL &&
empathy_contact_can_voip_video (priv->contact);
@@ -2353,8 +2362,6 @@ empathy_call_window_connected (gpointer user_data)
empathy_call_window_update_timer (self);
gtk_action_set_sensitive (priv->menu_fullscreen, TRUE);
-
- return FALSE;
}
static gboolean
@@ -2381,13 +2388,6 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
g_mutex_lock (priv->lock);
- if (priv->call_state != CONNECTED)
- {
- g_timer_start (priv->timer);
- priv->timer_id = g_idle_add (empathy_call_window_connected, self);
- priv->call_state = CONNECTED;
- }
-
switch (media_type)
{
case TP_MEDIA_STREAM_TYPE_AUDIO:
@@ -2676,6 +2676,8 @@ empathy_call_window_realized_cb (GtkWidget *widget, EmpathyCallWindow *window)
EmpathyCallWindowPriv *priv = GET_PRIV (window);
TpyCallChannel *call;
+ g_signal_connect (priv->handler, "state-changed",
+ G_CALLBACK (empathy_call_window_state_changed_cb), window);
g_signal_connect (priv->handler, "conference-added",
G_CALLBACK (empathy_call_window_conference_added_cb), window);
g_signal_connect (priv->handler, "conference-removed",