[empathy: 72/99] Minimize the scope in which we use TpyCallChannel



commit e9d88fb3832f3014e8ed9aaf2ce5bb1f4b96fd49
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Wed Mar 23 15:00:08 2011 +0000

    Minimize the scope in which we use TpyCallChannel

 src/empathy-call-window.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index f16e6d4..af47e2a 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2545,9 +2545,6 @@ static void
 start_call (EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  TpyCallChannel *call;
-
-  g_object_get (priv->handler, "call-channel", &call, NULL);
 
   priv->call_started = TRUE;
   empathy_call_handler_start_call (priv->handler,
@@ -2555,7 +2552,11 @@ start_call (EmpathyCallWindow *self)
 
   if (empathy_call_handler_has_initial_video (priv->handler))
     {
-      TpySendingState s = tpy_call_channel_get_video_state (call);
+      TpyCallChannel *call;
+      TpySendingState s;
+
+      g_object_get (priv->handler, "call-channel", &call, NULL);
+      s = tpy_call_channel_get_video_state (call);
 
       if (s == TPY_SENDING_STATE_PENDING_SEND ||
           s == TPY_SENDING_STATE_SENDING)
@@ -2577,9 +2578,9 @@ start_call (EmpathyCallWindow *self)
               add_video_preview_to_pipeline (self);
             }
         }
-    }
 
-  g_object_unref (call);
+      g_object_unref (call);
+    }
 }
 
 static gboolean



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