Commit 0e0e78e8 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

devicemonitor: don't fail when started without any filters

Just show all devices then.
parent 9b07b935
......@@ -35,7 +35,7 @@
* the application has set.
*
*
* The basic use pattern of an iterator is as follows:
* The basic use pattern of a device monitor is as follows:
* |[
* static gboolean
* my_bus_func (GstBus * bus, GstMessage * message, gpointer user_data)
......@@ -348,8 +348,10 @@ gst_device_monitor_start (GstDeviceMonitor * monitor)
if (monitor->priv->filters->len == 0) {
GST_OBJECT_UNLOCK (monitor);
GST_WARNING_OBJECT (monitor, "No filters have been set");
return FALSE;
GST_WARNING_OBJECT (monitor, "No filters have been set, will expose all "
"devices found");
gst_device_monitor_add_filter (monitor, NULL, NULL);
GST_OBJECT_LOCK (monitor);
}
if (monitor->priv->providers->len == 0) {
......
......@@ -420,8 +420,6 @@ GST_START_TEST (test_device_monitor)
mon = gst_device_monitor_new ();
fail_if (gst_device_monitor_start (mon));
devices = g_list_append (NULL, test_device_new ());
devs = gst_device_monitor_get_devices (mon);
......@@ -533,6 +531,12 @@ GST_START_TEST (test_device_monitor)
gst_object_unref (dp);
gst_object_unref (dp2);
g_list_free_full (devices, (GDestroyNotify) gst_object_unref);
/* should work fine without any filters */
mon = gst_device_monitor_new ();
fail_unless (gst_device_monitor_start (mon));
gst_device_monitor_stop (mon);
gst_object_unref (mon);
}
GST_END_TEST;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment