[empathy/gnome-2-30] Don't try to start change the camera when there is no input



commit 3e84f4f327d98ba3f696efc893bb80c9e2af5e46
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Sat May 8 17:20:25 2010 +0100

    Don't try to start change the camera when there is no input
    
    Fixes bug #618167

 src/empathy-call-window.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 6ae3a4d..60404f3 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -847,6 +847,13 @@ enable_camera (EmpathyCallWindow *self)
   if (priv->camera_state == CAMERA_STATE_ON)
     return;
 
+  if (priv->video_input == NULL)
+    {
+      DEBUG ("Can't enable camera, no input");
+      return;
+    }
+
+
   DEBUG ("Enable camera");
 
   empathy_call_window_set_send_video (self, TRUE);
@@ -2240,6 +2247,8 @@ empathy_call_window_remove_video_input (EmpathyCallWindow *self)
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
   GstElement *preview;
 
+  disable_camera (self);
+
   DEBUG ("remove video input");
   preview = empathy_video_widget_get_element (
     EMPATHY_VIDEO_WIDGET (priv->video_preview));
@@ -2258,11 +2267,8 @@ empathy_call_window_remove_video_input (EmpathyCallWindow *self)
   gtk_widget_destroy (priv->video_preview);
   priv->video_preview = NULL;
 
-  gtk_toggle_tool_button_set_active (
-      GTK_TOGGLE_TOOL_BUTTON (priv->tool_button_camera_on), FALSE);
   gtk_widget_set_sensitive (priv->tool_button_camera_on, FALSE);
-
-  gtk_widget_show (priv->self_user_avatar_widget);
+  gtk_widget_set_sensitive (priv->tool_button_camera_preview, FALSE);
 }
 
 static void



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