Commit 8caf9b7a authored by Wim Taymans's avatar Wim Taymans

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.
parent 997115e4
......@@ -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:
return devices;
return g_list_reverse (devices);
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