diff options
-rw-r--r-- | src/4a-internals-hal/4a-internals-hal-mixer-link.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-mixer-link.c b/src/4a-internals-hal/4a-internals-hal-mixer-link.c index 96e5552..8b15afc 100644 --- a/src/4a-internals-hal/4a-internals-hal-mixer-link.c +++ b/src/4a-internals-hal/4a-internals-hal-mixer-link.c @@ -117,7 +117,9 @@ int InternalHalHandleMixerAttachResponse(afb_api_t apiHandle, struct InternalHal if(wrap_json_unpack(mixerResponseJ, "{s?:o}", "streams", &mixerStreamsJ)) { - AFB_API_ERROR(apiHandle, "Can't get streams object in '%s'", json_object_get_string(mixerResponseJ)); + AFB_API_ERROR(apiHandle, + "An error happened when tried to decode mixer response ('%s')", + json_object_get_string(mixerResponseJ)); return -2; } @@ -132,6 +134,10 @@ int InternalHalHandleMixerAttachResponse(afb_api_t apiHandle, struct InternalHal return -3; } } + else { + AFB_API_WARNING(apiHandle, "No stream was created by mixer ('%s')", json_object_get_string(mixerResponseJ)); + return 1; + } return 0; } @@ -211,22 +217,29 @@ int InternalHalAttachToMixer(afb_api_t apiHandle) err = -7; } else if(! responseJ) { - AFB_API_ERROR(apiHandle, - "Seems that %s call to api %s succeed but no response was returned", - MIXER_ATTACH_VERB, - apiToCall); - err = -8; + AFB_API_WARNING(apiHandle, + "Seems that %s call to api %s succeed but no response was returned", + MIXER_ATTACH_VERB, + apiToCall); } else { mixerError = InternalHalHandleMixerAttachResponse(apiHandle, currentHalData->internalHalData, responseJ); - if(mixerError) { + if(mixerError < 0) { AFB_API_ERROR(apiHandle, - "Seems that %s call to api %s succeed but this warning was risen by response decoder : %i '%s'", + "Seems that %s call to api %s succeed but this error was send by response decoder : %i '%s'", MIXER_ATTACH_VERB, apiToCall, mixerError, json_object_get_string(responseJ)); - err = -9; + err = -8; + } + else if(mixerError > 0) { + AFB_API_WARNING(apiHandle, + "Seems that %s call to api %s succeed but warning %i was rised by response decoder : '%s'", + MIXER_ATTACH_VERB, + apiToCall, + mixerError, + json_object_get_string(responseJ)); } else { AFB_API_NOTICE(apiHandle, |