]> git.0d.be Git - empathy.git/commitdiff
CameraMenu: don't change the device if it's the current one
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Fri, 19 Aug 2011 12:01:59 +0000 (13:01 +0100)
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Fri, 19 Aug 2011 12:52:59 +0000 (13:52 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=656885

src/empathy-camera-menu.c

index a5725387291cdb5d81973fdc17a81798450831bd..cee11d75978d40746a7e195c9a42dbba543c326c 100644 (file)
@@ -132,6 +132,7 @@ empathy_camera_menu_activate_cb (GtkAction *action,
 {
   EmpathyGstVideoSrc *video;
   const gchar *device;
+  gchar *current_device;
 
   if (self->priv->in_update)
     return;
@@ -139,10 +140,18 @@ empathy_camera_menu_activate_cb (GtkAction *action,
   video = empathy_call_window_get_video_src (self->priv->window);
 
   device = gtk_action_get_name (action);
+  current_device = empathy_video_src_dup_device (video);
+
+  /* Don't change the device if it's the currently used one */
+  if (!tp_strdiff (device, current_device))
+    goto out;
 
   empathy_call_window_play_camera (self->priv->window, FALSE);
   empathy_video_src_change_device (video, device);
   empathy_call_window_play_camera (self->priv->window, TRUE);
+
+ out:
+  g_free (current_device);
 }
 
 static void