mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
deviceprovider: fix probing without starting
self->type is needed in registry_event_global() so it must be set in gst_pipewire_device_provider_probe() as well. self->devices is initialized as NULL when probing is started. So it should be just a simple GList* pointer. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
parent
0a6fe99a63
commit
37e66c9e55
2 changed files with 7 additions and 3 deletions
|
|
@ -265,7 +265,7 @@ static void do_add_node(void *data)
|
||||||
nd->dev = new_node (self, nd);
|
nd->dev = new_node (self, nd);
|
||||||
if (nd->dev) {
|
if (nd->dev) {
|
||||||
if(self->list_only)
|
if(self->list_only)
|
||||||
*self->devices = g_list_prepend (*self->devices, gst_object_ref_sink (nd->dev));
|
self->devices = g_list_prepend (self->devices, gst_object_ref_sink (nd->dev));
|
||||||
else
|
else
|
||||||
gst_device_provider_device_add (GST_DEVICE_PROVIDER (self), nd->dev);
|
gst_device_provider_device_add (GST_DEVICE_PROVIDER (self), nd->dev);
|
||||||
}
|
}
|
||||||
|
|
@ -555,6 +555,8 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
||||||
|
|
||||||
t = pw_core_get_type(c);
|
t = pw_core_get_type(c);
|
||||||
|
|
||||||
|
self->type = pw_core_get_type (c);
|
||||||
|
|
||||||
if (!(r = pw_remote_new (c, NULL, sizeof(*data))))
|
if (!(r = pw_remote_new (c, NULL, sizeof(*data))))
|
||||||
goto failed;
|
goto failed;
|
||||||
|
|
||||||
|
|
@ -612,7 +614,9 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
||||||
pw_core_destroy (c);
|
pw_core_destroy (c);
|
||||||
pw_loop_destroy (l);
|
pw_loop_destroy (l);
|
||||||
|
|
||||||
return *self->devices;
|
self->type = NULL;
|
||||||
|
|
||||||
|
return self->devices;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
pw_loop_destroy (l);
|
pw_loop_destroy (l);
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ struct _GstPipeWireDeviceProvider {
|
||||||
|
|
||||||
gboolean end;
|
gboolean end;
|
||||||
gboolean list_only;
|
gboolean list_only;
|
||||||
GList **devices;
|
GList *devices;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstPipeWireDeviceProviderClass {
|
struct _GstPipeWireDeviceProviderClass {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue