mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
ges: discoverer-manager: Allow recursing discovery
When using deeply nested timelines with the `ges:` protocol the formatters ends up trying to do discovery from the same thread current discovery happens, leading to infinite freeze as GstDiscoverer can't run several discoveries at the same time. By ensuring that when calling `gst_discoverer_discover_uri_async` no `GstDiscoverer` is set as "thread discoverer" we know that another discoverer will be created if discovery recurses, effectively removing the freeze. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5608>
This commit is contained in:
parent
78bc3d53dd
commit
71aa451870
1 changed files with 8 additions and 3 deletions
|
@ -321,11 +321,12 @@ ges_discoverer_manager_get_discoverer (GESDiscovererManager * self)
|
|||
ret = g_hash_table_lookup (self->discoverers, g_thread_self ());
|
||||
if (!ret) {
|
||||
ret = create_discoverer (self);
|
||||
g_hash_table_insert (self->discoverers, g_thread_self (), ret);
|
||||
} else {
|
||||
g_hash_table_steal (self->discoverers, g_thread_self ());
|
||||
}
|
||||
g_mutex_unlock (&self->lock);
|
||||
|
||||
return gst_object_ref (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -339,7 +340,11 @@ ges_discoverer_manager_start_discovery (GESDiscovererManager * self,
|
|||
discoverer = ges_discoverer_manager_get_discoverer (self);
|
||||
|
||||
gboolean res = gst_discoverer_discover_uri_async (discoverer, uri);
|
||||
gst_object_unref (discoverer);
|
||||
|
||||
g_mutex_lock (&self->lock);
|
||||
g_hash_table_insert (self->discoverers, g_thread_self (), discoverer);
|
||||
g_mutex_unlock (&self->lock);
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue