From 0263257783f02848b55b9eef2e5d46c4ee98b684 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 15 Jan 2016 00:25:05 +0530 Subject: [PATCH] GstDeviceMonitor: Don't remove unmatched class filters If no providers for a particular class could be found, then removing unmatched filters would cause all devices to be returned instead which is not at all what the user intended. We still return 0 for unmatched filters. --- gst/gstdevicemonitor.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gst/gstdevicemonitor.c b/gst/gstdevicemonitor.c index a9eda0ab91..4e6ecb326a 100644 --- a/gst/gstdevicemonitor.c +++ b/gst/gstdevicemonitor.c @@ -695,12 +695,9 @@ gst_device_monitor_add_filter (GstDeviceMonitor * monitor, /* Ensure there is no leak here */ g_assert (factories == NULL); - if (matched) { + if (matched) id = filter->id; - g_ptr_array_add (monitor->priv->filters, filter); - } else { - device_filter_free (filter); - } + g_ptr_array_add (monitor->priv->filters, filter); GST_OBJECT_UNLOCK (monitor);