GST_INFO ("getting device provider \"%s\"", GST_OBJECT_NAME (factory));
- if (factory->type == 0)
+ if (factory->type == G_TYPE_INVALID)
goto no_type;
device_provider = g_atomic_pointer_get (&newfactory->provider);
* also set name as early as we can
*/
device_provider = g_object_new (factory->type, NULL);
- if (G_UNLIKELY (device_provider == NULL))
- goto no_device_provider;
+ if (G_UNLIKELY (!device_provider)) {
+ gst_object_unref (factory);
+ g_return_val_if_fail (device_provider != NULL, NULL);
+ }
/* fill in the pointer to the factory in the device provider class. The
* class will not be unreffed currently.
gst_object_unref (factory);
return NULL;
}
-no_device_provider:
- {
- GST_WARNING_OBJECT (factory, "could not create device provider");
- gst_object_unref (factory);
- return NULL;
- }
}
/**