* 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;
- }
}
/**
element = (GstElement *) g_object_new_with_properties (factory->type, n,
names, values);
-
- if (G_UNLIKELY (element == NULL))
- goto no_element;
+ if (G_UNLIKELY (!element)) {
+ gst_object_unref (factory);
+ g_return_val_if_fail (element != NULL, NULL);
+ }
/* fill in the pointer to the factory in the element class. The
* class will not be unreffed currently.
gst_object_unref (factory);
return NULL;
}
-no_element:
- {
- GST_WARNING_OBJECT (factory, "could not create element");
- gst_object_unref (factory);
- return NULL;
- }
}
/**