summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/4a-internals-hal/4a-internals-hal-alsacore-link.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-alsacore-link.c b/src/4a-internals-hal/4a-internals-hal-alsacore-link.c
index 6cfdfba..0243a7b 100644
--- a/src/4a-internals-hal/4a-internals-hal-alsacore-link.c
+++ b/src/4a-internals-hal/4a-internals-hal-alsacore-link.c
@@ -194,7 +194,7 @@ int InternalHalSubscribeToAlsaCardEvent(afb_api_t apiHandle, char *cardId)
int InternalHalGetAlsaCtlInfo(afb_api_t apiHandle, char *cardId, struct InternalHalAlsaCtl *currentAlsaCtl, json_object **returnedDataJ)
{
- int err = 0, wrapRet;
+ int wrapRet;
char *returnedError = NULL, *returnedInfo = NULL;
@@ -219,7 +219,7 @@ int InternalHalGetAlsaCtlInfo(afb_api_t apiHandle, char *cardId, struct Internal
if(currentAlsaCtl->name && currentAlsaCtl->numid > 0) {
AFB_API_DEBUG(apiHandle,
- "Both a control name (%s) and a control uid (%i) are specified, control uid will be used",
+ "Both a control name (%s) and a control id (%i) are specified, control id will be used",
currentAlsaCtl->name,
currentAlsaCtl->numid);
}
@@ -272,20 +272,15 @@ int InternalHalGetAlsaCtlInfo(afb_api_t apiHandle, char *cardId, struct Internal
ALSACORE_API);
return -7;
}
- else if(currentAlsaCtl->name && wrap_json_unpack(responseJ, "{s:i}", "id", &currentAlsaCtl->numid)) {
- AFB_API_ERROR(apiHandle, "Can't find alsa control 'id' from control 'name': '%s' on device '%s'", currentAlsaCtl->name, cardId);
- json_object_put(responseJ);
- return -8;
- }
*returnedDataJ = responseJ;
- return err;
+ return 0;
}
int InternalHalUpdateAlsaCtlProperties(afb_api_t apiHandle, char *cardId, struct InternalHalAlsaCtl *currentAlsaCtl)
{
- int err = 0;
+ int err;
char *name;
@@ -316,8 +311,7 @@ int InternalHalUpdateAlsaCtlProperties(afb_api_t apiHandle, char *cardId, struct
currentAlsaCtl->numid,
cardId,
json_object_get_string(returnedDataJ));
-
- err = -10;
+ err = -9;
}
else {
currentAlsaCtl->name = strdup(name);
@@ -352,7 +346,7 @@ int InternalHalGetAlsaCtlValues(afb_api_t apiHandle, char *cardId, struct Intern
cardId,
json_object_get_string(returnedValuesArrayJ));
- err = -9;
+ err = -8;
}
else if(! json_object_is_type(returnedValuesArrayJ, json_type_array)) {
AFB_API_ERROR(apiHandle,
@@ -361,7 +355,7 @@ int InternalHalGetAlsaCtlValues(afb_api_t apiHandle, char *cardId, struct Intern
cardId,
json_object_get_string(returnedValuesArrayJ));
- err = -10;
+ err = -9;
}
if(! err)