mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 03:45:39 +00:00
deviceprovider: set the bus to non-flushing before calling klass->start
Not posting DEVICE_ADDED messages while a device provider is being started makes things awkward for applications, as they have to call get_devices() after starting the monitor. This requires redundant code on the application side, and as far as I understand also could cause race conditions, when a device gets added between the calls to gst_device_monitor_start() and gst_device_monitor_get_devices(), causing the application to "see" the same device twice.
This commit is contained in:
parent
9cf764b2ec
commit
a9e2776074
1 changed files with 4 additions and 1 deletions
|
@ -457,12 +457,15 @@ gst_device_provider_start (GstDeviceProvider * provider)
|
|||
goto started;
|
||||
}
|
||||
|
||||
gst_bus_set_flushing (provider->priv->bus, FALSE);
|
||||
|
||||
if (klass->start)
|
||||
ret = klass->start (provider);
|
||||
|
||||
if (ret) {
|
||||
provider->priv->started_count++;
|
||||
gst_bus_set_flushing (provider->priv->bus, FALSE);
|
||||
} else if (provider->priv->started_count == 0) {
|
||||
gst_bus_set_flushing (provider->priv->bus, TRUE);
|
||||
}
|
||||
|
||||
started:
|
||||
|
|
Loading…
Reference in a new issue