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