summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-07-16 17:25:24 +0200
committerWim Taymans <wtaymans@redhat.com>2015-07-16 18:54:50 +0200
commit8caf9b7a8744a6a6ae617f6d27f8cb7f17acccdc (patch)
tree6b889ed4085d8200db1057128e278f2872257052 /gst
parent997115e462e4c0790e4584abf06b716a1f027923 (diff)
devicemonitor: keep order of providers and devices
The deviceproviders are added to the array sorted by their rank. Make sure we keep this ordering when removing a provider. We use _prepend to collect the devices, use g_list_reverse to get the devices in the right order; sorted by rank and in the same order as returned by the provider.
Diffstat (limited to 'gst')
-rw-r--r--gst/gstdevicemonitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/gstdevicemonitor.c b/gst/gstdevicemonitor.c
index b05593446..994263a45 100644
--- a/gst/gstdevicemonitor.c
+++ b/gst/gstdevicemonitor.c
@@ -209,7 +209,7 @@ gst_device_monitor_remove (GstDeviceMonitor * self, guint i)
GstDeviceProvider *provider = g_ptr_array_index (self->priv->providers, i);
GstBus *bus;
- g_ptr_array_remove_index_fast (self->priv->providers, i);
+ g_ptr_array_remove_index (self->priv->providers, i);
bus = gst_device_provider_get_bus (provider);
g_signal_handlers_disconnect_by_func (bus, bus_sync_message, self);
@@ -324,7 +324,7 @@ again:
GST_OBJECT_UNLOCK (monitor);
- return devices;
+ return g_list_reverse (devices);
}
/**