- status = bt_self_component_sink_add_input_port(comp, in_port_name,
- NULL, NULL);
- if (status != BT_SELF_COMPONENT_STATUS_OK) {
- goto error;
+ add_port_status = bt_self_component_sink_add_input_port(comp,
+ in_port_name, NULL, NULL);
+ switch (add_port_status) {
+ case BT_SELF_COMPONENT_ADD_PORT_STATUS_OK:
+ status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK;
+ break;
+ case BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR:
+ status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR;
+ break;
+ case BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR:
+ status = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_MEMORY_ERROR;
+ break;
+ default:
+ abort();