mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
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.
This commit is contained in:
parent
997115e462
commit
8caf9b7a87
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue