diff options
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c')
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c b/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c index ed06b27..2960537 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c +++ b/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c @@ -45,23 +45,26 @@ void HalUtlActionOnMixer(afb_req_t request, enum ActionOnMixerType actionType) json_object *requestJson, *responseJ = NULL, *toReturnJ = NULL; - if(! (apiHandle = afb_req_get_api(request))) { - afb_req_fail(request, "api_handle", "Can't get current hal controller api handle"); + apiHandle = afb_req_get_api(request); + if(! apiHandle) { + afb_req_fail(request, "api_handle", "Can't get current hal api handle"); return; } - if(! (ctrlConfig = (CtlConfigT *) afb_api_get_userdata(apiHandle))) { - afb_req_fail(request, "hal_controller_config", "Can't get current hal controller config"); + ctrlConfig = (CtlConfigT *) afb_api_get_userdata(apiHandle); + if(! ctrlConfig) { + afb_req_fail(request, "hal_controller_config", "Can't get current internal hal controller config"); return; } currentHalData = (struct HalData *) getExternalData(ctrlConfig); if(! currentHalData) { - afb_req_fail(request, "hal_controller_data", "Can't get current hal controller data"); + afb_req_fail(request, "hal_controller_data", "Can't get current internal hal controller data"); return; } - if(! (requestJson = afb_req_json(request))) { + requestJson = afb_req_json(request); + if(! requestJson) { afb_req_fail(request, "request_json", "Can't get request json"); return; } @@ -261,14 +264,15 @@ struct InternalHalMixerData *HalUtlAddStreamDataAndCreateStreamVerb(afb_api_t ap createdStreamData->verbToCall = strdup(verbToCall); createdStreamData->streamCardId = strdup(streamCardId); - if((! createdStreamData->verb) || - (! createdStreamData->verbToCall) || - (! createdStreamData->streamCardId)) { + if(! createdStreamData->verb || + ! createdStreamData->verbToCall || + ! createdStreamData->streamCardId) { HalUtlRemoveSelectedMixerData(¤tHalData->internalHalData->streamsData, createdStreamData); return NULL; } - if(! (createdStreamData->event = afb_api_make_event(apiHandle, createdStreamData->verb))) { + createdStreamData->event = afb_api_make_event(apiHandle, createdStreamData->verb); + if(! createdStreamData->event) { HalUtlRemoveSelectedMixerData(¤tHalData->internalHalData->streamsData, createdStreamData); return NULL; } |