Skip to content
Snippets Groups Projects
Commit 0fac2957 authored by Vivien Didelot's avatar Vivien Didelot Committed by Tristan Matthews
Browse files

gnome: fix toggle screenshare

When switching back to the active camera, the device name is used
instead of the MRL, causing the client to crash.

Change-Id: Ib9eb95315ac32016cf2de9ab1edcb238f0d4653e
parent 067561c3
No related branches found
No related tags found
No related merge requests found
...@@ -1030,27 +1030,22 @@ void ...@@ -1030,27 +1030,22 @@ void
sflphone_toggle_screenshare(void) sflphone_toggle_screenshare(void)
{ {
static gboolean screenshare = TRUE; static gboolean screenshare = TRUE;
gboolean switched;
gchar *resource; gchar *resource;
if (screenshare) { if (screenshare) {
resource = sflphone_get_display(); resource = sflphone_get_display();
g_debug("enabling screen sharing (with MRL '%s')", resource);
switched = dbus_switch_video_input(resource);
} else { } else {
gchar *device; gchar *device = dbus_get_active_video_device();
device = dbus_get_active_video_device();
resource = g_strconcat("v4l2://", device, NULL); resource = g_strconcat("v4l2://", device, NULL);
g_debug("restoring camera '%s' (with MRL '%s'", device, resource);
switched = dbus_switch_video_input(device);
g_free(device); g_free(device);
} }
if (switched) if (dbus_switch_video_input(resource)) {
g_debug("switched video input to '%s'", resource);
screenshare = !screenshare; screenshare = !screenshare;
else } else {
g_error("failed to switch to resource '%s'\n", resource); g_error("failed to switch to resource '%s'\n", resource);
}
g_free(resource); g_free(resource);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment