aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-17 22:21:32 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-01 16:15:39 +0800
commit961ccc0473138e4dd195b7af6e80d0a43ae2463f (patch)
tree5f830a8f85b87eb55cdcc5af59e0f85184273a03
parent1f5ff2f5609f1915d20140f0446a47088c3d6fb5 (diff)
downloadgsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.tar
gsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.tar.gz
gsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.tar.bz2
gsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.tar.lz
gsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.tar.xz
gsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.tar.zst
gsoc2013-empathy-961ccc0473138e4dd195b7af6e80d0a43ae2463f.zip
Fix race when restarting a call
Fix a race between user hitting the 'redial' button and the pipeline being ready.
-rw-r--r--src/empathy-call-window.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index e69e2436c..34f899066 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -200,6 +200,8 @@ struct _EmpathyCallWindowPriv
/* TRUE if the call should be started when the pipeline is playing */
gboolean start_call_when_playing;
+ /* TRUE if we requested to set the pipeline in the playing state */
+ gboolean pipeline_playing;
};
#define GET_PRIV(o) \
@@ -955,6 +957,8 @@ create_pipeline (EmpathyCallWindow *self)
g_assert (priv->pipeline == NULL);
priv->pipeline = gst_pipeline_new (NULL);
+ priv->pipeline_playing = FALSE;
+
bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline));
priv->bus_message_source_id = gst_bus_add_watch (bus,
empathy_call_window_bus_message, self);
@@ -2373,6 +2377,7 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
if (newstate == GST_STATE_PAUSED)
{
gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
+ priv->pipeline_playing = TRUE;
if (priv->start_call_when_playing)
start_call (self);
@@ -2756,7 +2761,13 @@ empathy_call_window_restart_call (EmpathyCallWindow *window)
priv->outgoing = TRUE;
empathy_call_window_set_state_connecting (window);
- start_call (window);
+ if (priv->pipeline_playing)
+ start_call (window);
+ else
+ /* call will be started when the pipeline is ready */
+ priv->start_call_when_playing = TRUE;
+
+
empathy_call_window_setup_avatars (window, priv->handler);
gtk_action_set_sensitive (priv->redial, FALSE);