[empathy] Don't try to start change the camera when there is no input



commit 81f64a90c243f460624ab1ddb2fb7954ac755d94
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 |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 153da46..1f23be3 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -775,8 +775,10 @@ display_video_preview (EmpathyCallWindow *self,
       DEBUG ("Show self avatar");
 
       if (priv->video_preview != NULL)
-        gtk_widget_hide (priv->video_preview);
-      play_camera (self, FALSE);
+        {
+          gtk_widget_hide (priv->video_preview);
+          play_camera (self, FALSE);
+        }
       gtk_widget_show (priv->self_user_avatar_widget);
     }
 }
@@ -907,6 +909,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);
@@ -2356,6 +2365,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));
@@ -2374,11 +2385,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]