[empathy] restart the camera only if it's already running



commit f25f43bb57d892d433d5a61e40d100440fd0f222
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Nov 21 13:50:14 2011 +0100

    restart the camera only if it's already running
    
    Always restarting it will enable the camera in an audio only call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664459

 src/empathy-call-window.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 6e2df79..7a4994c 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -4181,10 +4181,17 @@ empathy_call_window_change_webcam (EmpathyCallWindow *self,
     const gchar *device)
 {
   EmpathyGstVideoSrc *video;
+  gboolean running;
 
+  /* Restart the camera only if it's already running */
+  running = (self->priv->video_preview != NULL);
   video = empathy_call_window_get_video_src (self);
 
-  empathy_call_window_play_camera (self, FALSE);
+  if (running)
+    empathy_call_window_play_camera (self, FALSE);
+
   empathy_video_src_change_device (video, device);
-  empathy_call_window_play_camera (self, TRUE);
+
+  if (running)
+    empathy_call_window_play_camera (self, TRUE);
 }



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