cheese/0004-camera-device-monitor-Don-t-add-NULL-devices-to-the-.patch
Hans de Goede 4c3b6761de Fix missing images on buttons, also fixes the "Gtk-WARNING **: Attempting to
add a widget with type GtkImage to a GtkButton ..." warnings (gnome#677543)
- Fix cheese crashing when started on machines with v4l2 radio or vbi devices
  (rhbz#810429, gnome#677544)
2012-06-06 15:15:02 +02:00

36 lines
1.3 KiB
Diff

From ab319f83cd02e1a75c4d546deaefb27da70b51e6 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 5 Jun 2012 14:54:13 +0200
Subject: [PATCH 4/4] camera-device-monitor: Don't add NULL devices to the
camera list
cheese_camera_device_monitor_set_up_device() will return NULL for non
video devices (ie vbi & radio devices). Emitting the added signal with
such a NULL device, causes it to get added to the camera list, which later
on causes cheese to crash.
This patch fixes this by not emitting the added signal for non camera devices.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
libcheese/cheese-camera-device-monitor.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcheese/cheese-camera-device-monitor.c b/libcheese/cheese-camera-device-monitor.c
index d8b5a10..aa723c7 100644
--- a/libcheese/cheese-camera-device-monitor.c
+++ b/libcheese/cheese-camera-device-monitor.c
@@ -214,7 +214,8 @@ cheese_camera_device_monitor_added (CheeseCameraDeviceMonitor *monitor,
GUdevDevice *udevice)
{
CheeseCameraDevice *device = cheese_camera_device_monitor_set_up_device (udevice);
- g_signal_emit (monitor, monitor_signals[ADDED], 0, device);
+ if (device)
+ g_signal_emit (monitor, monitor_signals[ADDED], 0, device);
}
/*
--
1.7.10.2