GstDeviceMonitor: Don't remove unmatched class filters
authorNirbheek Chauhan <nirbheek@centricular.com>
Thu, 14 Jan 2016 18:55:05 +0000 (00:25 +0530)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 14 Jan 2016 22:07:51 +0000 (22:07 +0000)
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

index a9eda0a..4e6ecb3 100644 (file)
@@ -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);