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:
Michael Olbrich 2019-06-18 09:53:12 +02:00 committed by Wim Taymans
parent 0a6fe99a63
commit 37e66c9e55
2 changed files with 7 additions and 3 deletions

View file

@ -265,7 +265,7 @@ static void do_add_node(void *data)
nd->dev = new_node (self, nd);
if (nd->dev) {
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
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);
self->type = pw_core_get_type (c);
if (!(r = pw_remote_new (c, NULL, sizeof(*data))))
goto failed;
@ -612,7 +614,9 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
pw_core_destroy (c);
pw_loop_destroy (l);
return *self->devices;
self->type = NULL;
return self->devices;
failed:
pw_loop_destroy (l);

View file

@ -98,7 +98,7 @@ struct _GstPipeWireDeviceProvider {
gboolean end;
gboolean list_only;
GList **devices;
GList *devices;
};
struct _GstPipeWireDeviceProviderClass {